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

[BLD]: run Rust integration tests in CI #2787

Merged
merged 9 commits into from
Sep 13, 2024

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented Sep 12, 2024

Description of changes

Does what it says on the tin. This PR also introduces Nextest, a new test runner (usage during local dev is optional). Nextest is currently 33% faster (when running locally) and has a lot of cool features that we may want to use in the future. In this PR, it's used to segment tests between those that require Tilt and those that do not.

Alternatives

Marking tests with #[ignore]

This is one option recommended by the Rust book. You annotate your expensive tests with #[ignore] and run cargo test -- --ignored when you wish to execute them.

This is simple, but feels very strange.

Using a Cargo feature flag/configuration flag

This was the prior approach and requires adding a build.rs file or updating Cargo.toml for every subcrate that potentially needs access to Tilt. Additionally, the DX isn't quite as nice because tests that require Tilt aren't normally compiled--meaning that you often won't notice that your change breaks some of these tests until you inspect the CI run.

Automatically managing Tilt

The Rust tests could automatically start Tilt for specific tests if necessary and keep the stack warm during tests. This seemed complex and potentially brittle.

Always run Tilt stack for all tests

We could just assume that the Tilt stack is available when running cargo test. This is super simple and imo the best alternative, but it's nice to be able to run the subset of tests not requiring Tilt separately. In CI this translates to faster feedback (starting Tilt is 5-7m) and locally translates to cheaper execution.

Test plan

How are these changes tested?

Tested in CI.

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

n/a

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@codetheweb codetheweb force-pushed the feat-run-rust-integration-tests-in-ci branch from ecb6c39 to c2bba1a Compare September 12, 2024 17:56
@codetheweb codetheweb force-pushed the feat-run-rust-integration-tests-in-ci branch 3 times, most recently from 023ba87 to fab9c1c Compare September 12, 2024 18:30
@codetheweb codetheweb force-pushed the feat-run-rust-integration-tests-in-ci branch from fab9c1c to 170aeea Compare September 12, 2024 19:11
@codetheweb codetheweb marked this pull request as ready for review September 12, 2024 22:18
rust/storage/src/s3.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@HammadB HammadB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aa-choo. I have a package allergy.

Thanks.

@codetheweb
Copy link
Contributor Author

🤧

@codetheweb codetheweb enabled auto-merge (squash) September 13, 2024 17:22
@codetheweb codetheweb merged commit 7fbc397 into main Sep 13, 2024
69 checks passed
@codetheweb codetheweb deleted the feat-run-rust-integration-tests-in-ci branch September 13, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants