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

add dev mode where warnings don't fail the test #11273

Merged
merged 6 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ tasks.withType<JavaCompile>().configureEach {
// We suppress the "options" warning because it prevents compilation on modern JDKs
"-Xlint:-options",
// jdk21 generates more serial warnings than previous versions
"-Xlint:-serial",

// Fail build on any warning
"-Werror"
"-Xlint:-serial"
)
)
if (System.getProperty("dev") != "true") {
// Fail build on any warning
compilerArgs.add("-Werror")
}
}

encoding = "UTF-8"
Expand Down
12 changes: 12 additions & 0 deletions docs/contributing/running-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ To run these tests locally, add `-PtestLatestDeps=true` to your existing `gradle

Executing `./gradlew :instrumentation:<INSTRUMENTATION_NAME>:test --tests <GROOVY TEST FILE NAME>` will run only the selected test.

### How to prevent linting and formatting warnings from failing tests

During local development, you may want to ignore lint warnings when running tests.

To ignore warnings, formatting issues, or other non-fatal issues in tests, use

```
./gradlew test -Ddev=true -x spotlessCheck -x checkstyleMain
```

The `dev` flag will ignore warnings in tests.

## Smoke tests

The smoke tests are not run as part of a global `test` task run since they take a long time and are
Expand Down
Loading