-
Notifications
You must be signed in to change notification settings - Fork 26
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
CONTRIBUTING.md
and Testing changes
#48
base: main
Are you sure you want to change the base?
Conversation
53ffc60
to
2928a74
Compare
…on-validator into aw-contributing-and-testing
@award28 Yeah of course :) There's two approaches we could take:
I've raised a quick fix for run.mjs in this PR. I'll start working on the changes needed to remove |
Definitely agree, thanks for the quick turn around! I've merged those changes into this branch. Based on feedback from #39, I should be good to remove the |
@mpalmer bumping this in case you missed it |
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.
Very, very cool. Made a couple of copy edit suggestions, and I've got a question or two, but it's great stuff, definite improvement over my shell script.
uses: mfinelli/setup-shfmt@master | ||
|
||
- name: Run shfmt | ||
run: shfmt -d bin/* test/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.
While test/run
is going away, the scripts in bin/
are going to hang around.
# Environment Setup | ||
|
||
## Install Rust | ||
Firstly, you'll need make any changes to the core functionality of this project. We recommend use `rustup`, on the recommendation of the rust team. You can find the installation instructions [here](https://www.rust-lang.org/tools/install). |
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.
Bit of light copy-editing:
Firstly, you'll need make any changes to the core functionality of this project. We recommend use `rustup`, on the recommendation of the rust team. You can find the installation instructions [here](https://www.rust-lang.org/tools/install). | |
Firstly, you'll need a Rust toolchain to make any changes to the core functionality of this project. We recommend [using `rustup`](https://www.rust-lang.org/tools/install), because that's what the Rust core team recommend. |
Submodule path 'src/schemastore': checked out 'd3e6ab7727380b214acbab05570fb09a3e5d2dfc' | ||
``` | ||
|
||
At this point, you should be all set to `cargo run`! If you run into any issues here, please [create an issue](https://github.com/mpalmer/action-validator/issues/new/choose). |
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.
At this point, you should be all set to `cargo run`! If you run into any issues here, please [create an issue](https://github.com/mpalmer/action-validator/issues/new/choose). | |
At this point, you should be all set to `cargo run`! |
Given we've got CI and (as I'm about to commit) nightly test builds, I'm willing to bet a reasonable sum that if cargo run
doesn't work for someone, it's a problem on their end, and I, at least, don't have the capacity to provide tech support for peoples' Rust installs.
When the tests is run, the results of the test must exactly match those of the previous run. For this project, | ||
the snapshot tests are named in the format `{next_id}_{whats_being_tested}` (e.g. `011_remote_checks_failure`). | ||
|
||
If you have made changes which will change the output of the program and cause snapshots to fail, you can 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.
Ooooh, shiny!
@@ -1,3 +1,5 @@ | |||
# Overview |
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 all good stuff, thanks for writing it up.
|
||
|
||
#[rstest] | ||
#[case("001_basic_workflow")] |
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.
Any chance we can sneak the list of tests to run straight off the filesystem, rather than having to list them here? Alternately, it seems like we're not exactly stretching the limits of rstest
; perhaps it's overkill, and just a fn main()
and a loop would do the trick for now?
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.
Like this?
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.
That seems like a very neat way of going about it. Macro magic to the rescue!
} | ||
} | ||
|
||
fn _save_contents( |
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.
What's the rationale for the _
prefix on these fns?
Any update on this? Happy to pick up the changes requested if you don't have capacity @award28 :) |
Hey @award28, do you have the bandwidth to push this through to completion, or shall @bcheidemann and myself finish it off and land it? |
Per @mpalmer's request in #39, I've extracted the testing and contributing changes into a separate PR. This still includes the changes to
save-snapshot
.@mpalmer
Should we still maintain the
run
test binary? I don't see a reason why we would need to, but there may be something I'm not thinking of.@bcheidemann From your comment here you mention
Could you lend me a hand on this PR to get those json files to work with the new testing approach?