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

Custom test path dependency broken with multi-config #5665

Closed
briandealwis opened this issue Apr 11, 2021 · 2 comments
Closed

Custom test path dependency broken with multi-config #5665

briandealwis opened this issue Apr 11, 2021 · 2 comments
Assignees
Labels
area/testing Issues concerning the testing phase of Skaffold feature/multi-configs kind/bug Something isn't working priority/p2 May take a couple of releases

Comments

@briandealwis
Copy link
Member

In GoogleContainerTools/container-debug-support#65 I'm trying to reorganize the skaffold debug helper images to use a Skaffold multi-config setup. I have a custom test definition that specifies dependencies using a pattern:

test:
  - image: skaffold-debug-nodejs
    structureTests: [structure-tests-nodejs.yaml]
    custom:
      - command: "cd helper-image; go test ."
        dependencies:
          paths: ["helper-image/*.go", "helper-image/go.*"]

But my build is failing (logs):

Generating tags...
 - skaffold-debug-go -> skaffold-debug-go:be78dcf
 - skaffold-debug-netcore -> skaffold-debug-netcore:be78dcf
 - skaffold-debug-nodejs -> skaffold-debug-nodejs:be78dcf
 - skaffold-debug-python -> skaffold-debug-python:be78dcf
Checking cache...
 - skaffold-debug-go: Error checking cache.
getting hash for artifact "skaffold-debug-go": getting dependencies for "skaffold-debug-go": pattern "/home/travis/build/GoogleContainerTools/container-debug-support/nodejs/helper-image/*.go" did not match any file

The paths field is marked as a skaffold:filepath but the underlying implementation uses list.Files() which causes problems as paths has been made absolute in the multi-config situation:

return list.Files(ct.testWorkingDir, test.Dependencies.Paths, test.Dependencies.Ignore)

but list.Files() assumes that it must prefix the file patterns with the working directory:
expanded, err := filepath.Glob(filepath.Join(workspace, pattern))

I'm wondering if we should apply to the skaffold:filepath adjustments to all configs rather than just child configs so that we discover these situations earlier.

Steps to reproduce the behavior

  1. Clone https://github.com/briandealwis/container-debug-support/tree/modules at commit briandealwis/container-debug-support@91c712b
  2. skaffold build
@briandealwis briandealwis added kind/bug Something isn't working feature/multi-configs labels Apr 11, 2021
@gsquared94 gsquared94 added the area/testing Issues concerning the testing phase of Skaffold label Apr 12, 2021
@gsquared94
Copy link
Contributor

This is what had prompted #5472. I don't think your alternative suggestion can catch these kinds of issues.

@tejal29 tejal29 added the priority/p2 May take a couple of releases label Apr 12, 2021
@tejal29 tejal29 self-assigned this Apr 26, 2021
@gsquared94
Copy link
Contributor

this should be fixed in #5677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Issues concerning the testing phase of Skaffold feature/multi-configs kind/bug Something isn't working priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

3 participants