Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-5353

Do not run up-to-date compilation tasks for test runs

    XMLWordPrintableJSON

Details

    Description

      When running {{debug.single }}project action, on a test in gradle project, the following is executed:

      ./gradlew --configure-on-demand 
      --rerun-tasks -x check test --tests com.example1.Demo22Test
      

      Note the --rerun-tasks parameter, which will recompile classes etc, even though gradle thinks they're up-to-date. Naturally something has to be done, since otherwise Gradle won't even run the tests. As noted in https://www.stefan-oehme.com/stop-rerunning-tests, Gradle should be aware of test input changes and will decide whether to actually run the test or not.

      Since this is a direct user instruction (from the IDE), we may use different approach: run cleanTest task before the test, which will invalidate test result from the build cache.

      lkishalmi  – what's your opinion on the above improvement ? Is it stable / gradle way ? It seems to work on my machine, but I lack experience with the build system details.

      Attachments

        Issue Links

          Activity

            People

              sdedic Svatopluk Dedic
              sdedic Svatopluk Dedic
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m