GoogleContainerTools/skaffold

All custom test commands seem to always be executed on file changes for a given image

Open

#7184 aperta il 13 mar 2022

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)Go (1416 fork)batch import
area/testinghelp wantedkind/bugkind/frictionpriority/p3

Metriche repository

Star
 (12.822 star)
Metriche merge PR
 (Merge medio 1g 18h) (18 PR mergiate in 30 g)

Descrizione

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.

  1. clone this project git@github.com:GoogleContainerTools/skaffold.git
  2. cd examples/custom-tests
  3. Comment out the dependencies block for the Hello world command
  4. skaffold dev
  5. 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.

Guida contributor