-
Notifications
You must be signed in to change notification settings - Fork 46
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
Set up CI/CD pipeline #43
Comments
@jasmingacic wrote:
Sure. Ping me on Packet Slack and we can coordinate. |
We have a few options. I generally steer people off of Travis since the private equity takeover and a lot of core engineers have left. Github Actions is great, but is unavailable to the packethost organization for various reasons. I moved ccm and csi to public drone cloud. They are free for OSS, and have full support for architectures Can you outline here what steps would be in a proper CI pipeline, I would be happy to set up a |
One of the questions is whether we should run integration tests before we do the build. What do you think? |
Other way around, I think. The build itself can highlight issues, save time on the integration tests, which usually take longer.
I assume you are planning on using git tags to cut releases? Sure, you can have actions that happen on tagging. On the other hand, you cannot create "pull requests" for tags (something I never have liked, true for all of github/gitlab/bitbucket), so you are just tagging an existing commit and pushing. We can create actions based on that that push out as releases. |
I agree the build will highlight the issues. Maybe integration tests should be left for the GO SDK. As for the flow we simply merge into master, and manually tag the release (commit) and let CI take over. We'd only have to have a rule in place who can create commit tags. |
Yes, agreed. I do wish tags were immutable, and that you could have a "Tag Request" like a "Pull Request" (just last week I was blocked from a large enterprise SDLC because this doesn't exist), but certainly good enough for here. |
I took a look at shot at setting up a Github Workflow for the CLI but that was detoured when #33 stands out as a reason why testing is hard in the current state, global variables are reused between commands, defining arguments and the client connection, and the commands cannot be isolated (each uses #66 offers a way to split up the commands, avoid the global state, and get unit tests introduced. (only |
I have a little update for this issue. We now have GitHub Workflows running on each PR and triggering builds/releases when tags are pushed.
On the topic of E2E tests, I would prefer high-coverage tests that use mocks rather than the real API for pull-requests. In this project, our goal is to have a working CLI, not a working API. I believe what should be tested here is narrowly:
and:
The output renderers would be noop'd when testing API responses. If API E2E tests are desired, that could be something run in a separate scheduled workflow. I only feel comfortable with these when we have an all-purpose Packet deleting tool that sweeps all resources in a project. Still some tests and resources are not project bound and we would need E2E test cleanup to handle those resources too. |
Arguably, this issue could be closed and we can open new issues focused on test coverage and scheduled e2e tests. Thoughts? |
Tags can now be introduced from the GitHub Releases tab.
I don't think this offers the most value. Mocked responses are faster to test and create and ensure that the client is working properly according to the presumptive API. It is not the job of the CLI to ensure that the API has not introduced breaking changes. I would defer those concerns to #106. #22 previously addressed E2E concerns but these were not well maintained, in part over the added complexity. IMHO, contributors to the project shouldn't be expected to spend money to test the software.
https://github.com/displague/metal-sweeper-action
Closing this in favor of a new issue to improve test coverage (using a CI test that ensures coverage is improved in each PR). |
As discussed here with @jasmingacic and @jacobsmith928 , we should have a proper CI/CD pipeline.
The text was updated successfully, but these errors were encountered: