Add support for manually passing options to examples.#409
Add support for manually passing options to examples.#409bdalrhm merged 4 commits intomodel-checking:main-154-2021-08-06from
Conversation
src/tools/dashboard/src/reference.rs
Outdated
| let config_dir: PathBuf = ["src", "tools", "dashboard", "configs"].iter().collect(); | ||
| let mut config_paths = HashSet::new(); | ||
| let mut stack = vec![config_dir]; | ||
| while !stack.is_empty() { |
There was a problem hiding this comment.
There's a walkdir crate and https://doc.rust-lang.org/1.2.0/std/fs/fn.walk_dir.html which seems to be marked unstable... are we able to use these? (Maybe the answer is no)
There was a problem hiding this comment.
It looks like fs::walk_dir got deprecated in favor of the crate. Replaced the code with the crate. Thanks!
| the latest versions of the Rust books. Please update the line \ | ||
| numbers of the config files and rerun the program.", |
There was a problem hiding this comment.
Have you chatted with the group about this? Sounds like this approach might be quite flaky?
I don't have any alternative ideas off the top of my head, though. Other than trying to find some git-fu that could automatically update the line numbers somehow.
There was a problem hiding this comment.
Yes. We talked about this in a previous Deep Dive. We considered automatically updating the line number, but that can introduce silent success/failure if the code-blocks change too. Nathan approved of this as a temporary solution for now, though it adds to the list of problems Adrian has to deal with in his weekly rebases.
* Add support for manually passing options to examples. * Ignore files with `.props` extension. * Use `WalkDir` instead of manually reading sub-directories.
* Add support for manually passing options to examples. * Ignore files with `.props` extension. * Use `WalkDir` instead of manually reading sub-directories.
…#409) * Add support for manually passing options to examples. * Ignore files with `.props` extension. * Use `WalkDir` instead of manually reading sub-directories.
* Add support for manually passing options to examples. * Ignore files with `.props` extension. * Use `WalkDir` instead of manually reading sub-directories.
Description of changes:
This PR adds support for manually passing options to examples in the Rust books. The dashboard now looks for configuration files under
src/tools/dashboard/configsand prepends the specified options in those files to the top of the extracted examples. With this PR, the number of failing tests drops from 19 to 16.Resolved issues:
Resolves #407
Call-outs:
This PR also fixes two encountered bugs where tests were not failing for the appropriate reasons:
Testing:
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.