All custom test commands seem to always be executed on file changes for a given image
#7,184 opened on 2022年3月13日
説明
Expected behavior
When declaring a list of custom test commands in skaffold yml its expected that commands only run if the changes are in files defined in their respective dependencies block.
Actual behavior
When 2 or more commands in a custom block for a image are defined in the skaffold yml it seems that ALL commands are executed regardless if the file changes is defined in the specific commands dependency block or not.
This seems to happen regardless if the command has a dependencies block defined or not. I.e. even if command 1 has a dependencies block containing a different path than command 2 both commands are executed if a change is made in any of the paths.
Information
- Skaffold version: 1.36.1, 1.35.2
- Operating system: Ubuntu 18.04.6 LTS
- Installed via: skaffold.dev
- Contents of skaffold.yaml:
apiVersion: skaffold/v2beta27
kind: Config
build:
artifacts:
- image: custom-test-example
test:
- image: custom-test-example
custom:
- command: ./test.sh
timeoutSeconds: 60
dependencies:
paths:
- "*_test.go"
- "test.sh"
- command: echo Hello world!!
#dependencies:
# command: echo [\"main_test.go\"]
deploy:
kubectl:
manifests:
- k8s-*
Steps to reproduce the behavior
It seems easy to reproduce in the example project.
- clone this project git@github.com:GoogleContainerTools/skaffold.git
- cd examples/custom-tests
- Comment out the dependencies block for the Hello world command
skaffold dev- Make any change in main_test.go and observe how both commands are executed in the console.
Same issue if you comment out the dependencies block for the ./test.sh command. Ie both commands still execute on a change in main_test.go.