GoogleContainerTools/skaffold

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

开放

#7,184 创建于 2022年3月13日

 (4 条评论) (0 个反应) (0 位负责人)Go (1,416 个派生)batch import
area/testinghelp wantedkind/bugkind/frictionpriority/p3

仓库指标

星标
 (12,822 个星标)
PR 合并指标
 (平均合并 3天 6小时) (30 天内合并 16 个 PR)

描述

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.

贡献者指南