-
Notifications
You must be signed in to change notification settings - Fork 17
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
Cleanup and bump glide.yaml and fix unit tests #129
Conversation
- package: github.com/maxwellhealth/bongo | ||
- package: github.com/pborman/uuid | ||
- package: github.com/spf13/cobra | ||
- package: github.com/spf13/viper | ||
- package: github.com/spf13/pflag |
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 one is needed to get the most recent pflag update, otherwise it breaks cobra.
- package: github.com/sirupsen/logrus | ||
- package: github.com/Sirupsen/logrus | ||
repo: git@github.com:/sirupsen/logrus | ||
vcs: git |
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.
glide is case sensitive
a405d0e
to
b88b17c
Compare
b88b17c
to
87caaaf
Compare
Also fixed circleci by reusing our docker image to test golang. Now, everything good to go, including tests in all the _test.go, with complete CI support
|
@@ -1,98 +0,0 @@ | |||
package kubedeploy_test |
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 removed it because the package name should be package kubedeploy
, which means it doesn't test the desired package before. Also, the agent is REALLY hard to setup the mock to pass the tests listed here. My 2 cents is that unit tests should be as unit as possible, for example, lots of the logic can be simply tested against the functions defined in kubedeploy/deployment, instead of calling it from agent -- kind of more like an integration test to me.
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 is an integration test, while we may not run it out of CI it's required when making changes to kubedeploy. All it needs is a test kube cluster to point at.. Usually we point at dev. I'd like to keep this test, is it getting in the way of the unit tests?
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, maybe I need to setup a test cluster to get it working, do we have some notes/docs about how to set it up?
If it's not CI testable, for example, hard to setup kubedeploy in CI, maybe we can put it as code and run it manually as an integration test.
@@ -22,11 +26,13 @@ import: | |||
subpackages: | |||
- jwk | |||
- package: github.com/libgit2/git2go | |||
version: v25 | |||
repo: https://gopkg.in/libgit2/git2go.v25.git | |||
vcs: git |
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.
@zhouzhuojie Why's this change required?
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.
It's not required, I can change it back - probably doesn't matter, before I was just testing and got glide upgrade errors
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.
agreed, lets keep the orig repository here.
steps: | ||
- checkout | ||
- run: cp ./dashboard/.env ./dashboard/.env.development | ||
- run: make test | ||
- run: docker build . -t codeflow-test | ||
- run: docker run --rm codeflow-test make test |
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 could definitely be sped up considerably.
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.
Yup, about 8min :(. Most of the time in the docker build is spent in npm install. I experimented with a lot of options in circleci, (https://circleci.com/gh/checkr/codeflow) really hard to get the libgit2 dependency working correctly, and then the docker build is kind of the last thing I can think to make it fully work. We can have a separate base image (without the npm update/install, pacman install etc.) to speed it up a little bit.
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 it's ok to build the docker here for now, the make test also does an npm install but I'm guessing it caches better? The other option might be to somehow wait for codeflow to build the docker image and then simply pull it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This pr is not urgent at all. Just want to send it anyway incase there's a need to bump glide in the future.
Spent some time clean up glide.yaml and finally got a successful upgrade. Especially the logrus package upgrade, I need to do something like, because glide is case sensitive, and downstream packages require both.
Here's how to run a full clean glide upgrade
Also, since some unit tests are broken, it's better to be another pr, but it relies on the glide update, so I've put them here. Really hope that Github can support stack code review.