GoogleContainerTools / GoogleContainerTools/skaffold
Skaffold should default to skipping tests (`--skip-tests` should default to true)
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
@ddobrin reported an unexpected consistency with a Maven build when using the Cloud Run emulation in Cloud Code, which uses Skaffold under the hood:
1. Buildpacks explicitly disables tests executes [`mvn clean package -DskipTests ...`](https://github.com/GoogleCloudPlatform/buildpacks/blob/master/cmd/java/maven/main.go#L97), and doesn't offer the ability to actually run tests.
2. Jib uses our `--skip-tests` flag to determine whether to pass `-DskipTests`.
In @ddobrin's case, this lead to deployment failure due to #7156 that could not be easily worked around as Cloud Code's emulator does not currently have a provision to configure the `--skip-tests` flag.
No other builder currently supports our `--skip-tests`: the bazel builder could [but doesn't](https://github.com/GoogleContainerTools/skaffold/blob/main/pkg/skaffold/build/bazel/build.go#L74), `ko publish` doesn't seem to offer that option.
My proposal:
1. We change the default for `--skip-tests` to `true`. So tests would be opt-in.
2. We warn in the builders when `--skip-tests` is not supported.
(We could even consider removing `--skip-tests`, as it's a bit counter-intuitive with `skaffold test`. But that's a much bigger change.)
cc: @sujit-kamireddy
Contributor guide
Assessment
This issue has not been assessed yet.