-
Notifications
You must be signed in to change notification settings - Fork 769
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
Container for running tests and Makefile cleanup #385
Conversation
@@ -0,0 +1,32 @@ | |||
# This Dockefile creates image where all Kompose tests can be run | |||
|
|||
FROM registry.centos.org/centos/centos:7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should use the docker hub centos base images
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about it. They should be build from same Dockerfile.
I don't know.
Why would you prefer image from docker hub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 other than my small changes.
This will make it 100% easier to replicate any tests that need to be ran!
@@ -0,0 +1,32 @@ | |||
# This Dockefile creates image where all Kompose tests can be run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing license at the top
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thx for noticing
# This Dockefile creates image where all Kompose tests can be run | ||
|
||
FROM registry.centos.org/centos/centos:7 | ||
MAINTAINER Tomas Kral <tkral@redhat.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAINTAINER has been deprecated in 1.13 of Docker :(.
Better to use LABEL maintainer Tomas Kral <tkral@redhat.com>
or remove it all-together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't know that.
I'll remove it, I don't think that it is something that we need for image. It was just something that I was used to doing.
Just a note though, I feel as though these tests run a lot slower than the original ones? I think it's because there's no cache being passed through? The part that's reallyyyy taking it's time is here:
Another being that what if I wanted to just run cmd or just run integration? |
Yes, no cache being passed through.
This pre-compiles all the dependencies for test. So it can take some time, but it will speed up running all the
Yes, I was thinking about it. I would like to do it in separate PR. I have some other ideas how to speed this up. But than it will run slightly different commands and tests from what is run in travis-ci. I wanted to replicated same thing that travis is doing first, and than add options to run faster but not complete test later. |
If you didn't setup user.email and user.name `git commit` fails. This configures user.email and user.name for newly created temporary git repo.
If command is simple command call it from Makefile, there is no need to have them in separate shell scripts.
I like how you keep the current tests in as well. But perhaps we can do it so that it's "test-container" or something? Would be easier for using it on travis, etc and for those who choose to run the container vs traditional. |
There is So you are suggesting changing it so |
@kadel |
done ;-) There is just one small catch with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
# run all test localy in docker image (image can be build by by build-test-image target) | ||
.PHONY: test-container | ||
test-container: | ||
docker run -v `pwd`:/opt/tmp/kompose:ro -it $(TEST_IMAGE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds Dockerfile that can be used to run all Kompose tests locally.
make test
will run exactly the same tests as travis-ci but running locally in docker image.This can be used to tests everything before commiting or submitting PR.
Image is automatically build in docker hub - https://hub.docker.com/r/kompose/tests/ or it can be build locally using
make test-image
.Automatic build at docker hub is NOT triggered automatically on push. Only time when rebuild is needed is when Dockerfile is changed.
This PR also includes Makefile and
/script/
cleanup.I've removed all the shell scripts that were just one single command and put those commands directly to Makefile. It is much more easier to figure out what is doing what.