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

Add documentation about local integration tests #1012

Closed
antechrestos opened this issue Jan 29, 2020 · 3 comments · Fixed by #1014
Closed

Add documentation about local integration tests #1012

antechrestos opened this issue Jan 29, 2020 · 3 comments · Fixed by #1014
Assignees
Labels
area/internal bugs related to kaniko development workflow community

Comments

@antechrestos
Copy link
Contributor

antechrestos commented Jan 29, 2020

Looking at the travis file, we can see that there is a way to run integration tests locally. This great feature was brought by the following pull request

I think this feature quite great and should be documented as it is quite usefull.

However, looking at how it is done, I found the script that updates the integration docker files and copies the base image from gcr.io to local registry.

If any developer did it on its laptop, it would end with git modified file which is annoying.

It can be solved in several way

  1. The light way

keep a save of each updated dockerfiles and use the trap command to rollback the changes at the end of the integration-test.sh script.

  1. The hard way
  • add a variable to Makefile INTEGRATION_REGISTRY valued by default to gcr.io
  • add the same variable to integration-test.sh valued by default to gcr.io
  • launch the copy from gcr.io to target if differents
  • either the light way or by using a build argument variable INTEGRATION_REGISTRY in each FROM command and use it in each docker command launched by tests.

I would be glad to implement any chosen solution, even a third one 😄

@tejal29
Copy link
Member

tejal29 commented Jan 29, 2020

Thanks @antechrestos for bringing this up! We want to make development experience better for all our open source contributors.
/cc @samos123

@samos123
Copy link
Contributor

samos123 commented Jan 29, 2020

All good points! I wasn't expecting there to be any demand outside of travis CI to run integration tests locally, but since there clearly is we should get it fixed.

Actually the best way would be to fix the google-go-container-registry to not require authentication with gcloud for public GCR repositories. The only reason I made this hacky solution that replaces the base image with local docker registry was due to that bug.

However if you wish to do it. I think the easiest and best solution for now would be to just not use GCR anywhere in the integration tests.

@tejal29 tejal29 added area/internal bugs related to kaniko development workflow community labels Jan 29, 2020
@samos123
Copy link
Contributor

I created a bug to go-containerregistry here: google/go-containerregistry#666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/internal bugs related to kaniko development workflow community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants