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

Make it easier to run CI tests locally #69

Closed
joshlf opened this issue Oct 16, 2022 · 8 comments
Closed

Make it easier to run CI tests locally #69

joshlf opened this issue Oct 16, 2022 · 8 comments
Labels
compatibility-nonbreaking Changes that are (likely to be) non-breaking

Comments

@joshlf
Copy link
Member

joshlf commented Oct 16, 2022

We currently run a large suite of tests in CI, which includes testing with different tools across different toolchains and different targets. It also involves miscellaneous things like confirming that README.md is up to date, that code is properly formatted with rustfmt, etc. In other words, it's not as simple as just running cargo test.

As a result, it's easy to make changes that appear fine locally but break CI, requiring an edit-commit-push cycle just to see if all of the CI tests will pass. We should make it easier to run most or all of these tests locally. For especially fast tests (like README.md and code formatting), we could even provide them as commit hooks.

@djkoloski also reports finding this to be painful (#69 (comment)):

I struggled specifically with formatting and forgetting to make stderr match in tests. Adding a way to format test files and an easier way to update all the stderr files for tests might be helpful. 🙂

The challenge here is going to be making these tests available without either a) moving everything out of our ci.yml and into a script (which means we don't get nice job output and error messages) or, b) duplicating everything (which is brittle).

@AntoniosBarotsis
Copy link
Contributor

You could also look into something like Toast.

@memark
Copy link
Contributor

memark commented Oct 16, 2022

Some interesting tools in this space are

@AntoniosBarotsis
Copy link
Contributor

One thing to keep in mind is that Act and I think Toast as well don't support Windows images (or at least didn't last time I tried IIRC).

@djkoloski
Copy link
Member

I struggled specifically with formatting and forgetting to make stderr match in tests. Adding a way to format test files and an easier way to update all the stderr files for tests might be helpful. 🙂

@joshlf
Copy link
Member Author

joshlf commented Nov 6, 2022

Awesome, added that to the issue description. This'll definitely be important to solve moving forward.

@joshlf
Copy link
Member Author

joshlf commented Nov 6, 2022

@djkoloski I took a stab at pulling the scripts out of ci.yml and into a shell script here. There's still work to be done, but I probably won't get it to a state where I can merge for a few days, so I figured I'd send you that in case you want to just keep a copy of it locally until I get it merged.

joshlf added a commit that referenced this issue May 24, 2023
Move some CI test bash infrastructure into `util.sh`. Implement a
rudimentary test runner in `test.sh`. Eventually, the intention is that
`test.sh` will mimic as closely as possible the tests that run during CI
so that developers can run those tests locally.

Part of #69
joshlf added a commit that referenced this issue May 25, 2023
Move some CI test bash infrastructure into `util.sh`. Implement a
rudimentary test runner in `test.sh`. Eventually, the intention is that
`test.sh` will mimic as closely as possible the tests that run during CI
so that developers can run those tests locally.

Part of #69
@joshlf joshlf added the compatibility-nonbreaking Changes that are (likely to be) non-breaking label Aug 12, 2023
@joshlf joshlf mentioned this issue Aug 20, 2023
@joshlf
Copy link
Member Author

joshlf commented May 3, 2024

@djkoloski do you feel like #728 and #1171 combined are sufficient to close this issue?

@djkoloski
Copy link
Member

Yes, this issue can be closed.

@joshlf joshlf closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility-nonbreaking Changes that are (likely to be) non-breaking
Projects
None yet
Development

No branches or pull requests

4 participants