Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] gradlew clean build dist not rerunning tests #2283

Open
1 of 3 tasks
skylot opened this issue Sep 19, 2024 · 2 comments
Open
1 of 3 tasks

[build] gradlew clean build dist not rerunning tests #2283

skylot opened this issue Sep 19, 2024 · 2 comments

Comments

@skylot
Copy link
Owner

skylot commented Sep 19, 2024

Issue details

clean task suppose to clean everything including tests cache, but sometimes tests still not running again.
--rerun-tasks should help, but it fails spotless task in eclipse formatter with ClassNotFoundException

Discussion started in #2280 (comment)

Jadx version

dev

Java version

17 and 21

OS

  • Windows
  • Linux
  • macOS
@skylot
Copy link
Owner Author

skylot commented Sep 19, 2024

@jpstotz I can confirm gradlew clean build dist not rerunning test for me on Windows, but works fine on Linux.

I will try to investigate this and try suggestions from https://stackoverflow.com/questions/29427020/how-to-run-gradle-test-when-all-tests-are-up-to-date

@skylot
Copy link
Owner Author

skylot commented Sep 19, 2024

According to gradle/gradle#9153 clean task just delete tests output, but not delete cache and this is expected behavior. It makes sense because if code not changed there is no point in running tests again.
But most tests in core are integration tests, they depend on other modules like input plugins. To force rerun, we can use this:

tasks.test {
	outputs.upToDateWhen { false }
}

Although, here is an article why this is a bad approach 🤣

Another approach is using --no-build-cache to disable build cache, and with clean task it is works fine for me.
Or disable cache only for integration tests like this:

tasks.test {
	outputs.cacheIf  { false }
}

Another option is to rerun only tests:

.\gradlew test --rerun-tasks

I think this is the best approach for now.

About spotless rerun issues, turns out it is some kind of threading issue, because error always different, and it solved by disabling parallel task execution. Anyway it looks like spotless issue 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant