-
Notifications
You must be signed in to change notification settings - Fork 158
flowey: vmm_tests: introduce step to verify all tests run on at least one runner #2094
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
3a064d5
initial work
b215a0c
fixes
92d4904
Add support for force published artifacts
233acfa
test out new force publish artifact step
ccbe79d
regen yaml
33381cf
Try new job
c46f87f
condense
e7826ba
Merge branch 'main' into add-verify-tests-step
693630a
Try a successful vmm_tests run
2c2795d
update pipeline files
6be7aa0
.
689dd30
fix typo
922d587
Prepare for review
51f8bb8
print debug logs
cb736c0
Handle both dirs and files gracefully
d1348e7
Remove logging statements
4c0d383
.
2962333
Proper refactor of publish_test_result.rs
3fa2e2e
More cleanup
044179e
Merge branch 'main' into add-verify-tests-step
e944546
Add file extension
2cd9f9d
Fix local vmm_tests
fcb1ed5
Scope changes in YAML
d522230
Address feedback
b4595ac
.
717272c
.
de175cb
Trim unnecessary optionals
2185870
Merge branch 'main' into add-verify-tests-step
4b8f415
Feedback
130e31e
Update comments and make the run_cargo_nextest_list command configurable
eea6cc1
Revert this change
2e1d8e2
Revert "Revert this change"
20e6604
.
98bfa23
Revert "."
2c1eccb
Merge branch 'main' into add-verify-tests-step
7c3499f
Merge branch 'main' into add-verify-tests-step
3a58241
address feedback
076177c
update base env according to main
6157e8c
Remove unused step
ccad775
Merge branch 'main' into add-verify-tests-step
e6d8b07
Allow skipping artifact publishing for closed source pipelines
553c0d6
Missing conversions for closed source fixup
3ab3b8b
Remove warnings from GH
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
93 changes: 93 additions & 0 deletions
93
flowey/flowey_lib_common/src/gen_cargo_nextest_list_cmd.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| //! Run cargo-nextest list subcommand. | ||
| use crate::gen_cargo_nextest_run_cmd; | ||
| use flowey::node::prelude::*; | ||
| use std::collections::BTreeMap; | ||
|
|
||
| flowey_request! { | ||
| pub struct Request { | ||
| /// What kind of test run this is (inline build vs. from nextest archive). | ||
| pub run_kind_deps: gen_cargo_nextest_run_cmd::RunKindDeps, | ||
| /// Working directory the test archive was created from. | ||
| pub working_dir: ReadVar<PathBuf>, | ||
| /// Path to `.config/nextest.toml` | ||
| pub config_file: ReadVar<PathBuf>, | ||
| /// Nextest profile to use when running the source code | ||
| pub nextest_profile: String, | ||
| /// Nextest test filter expression | ||
| pub nextest_filter_expr: Option<String>, | ||
| /// Additional env vars set when executing the tests. | ||
| pub extra_env: Option<ReadVar<BTreeMap<String, String>>>, | ||
| /// Generated cargo-nextest list command | ||
| pub command: WriteVar<gen_cargo_nextest_run_cmd::Command>, | ||
| } | ||
| } | ||
|
|
||
| new_flow_node!(struct Node); | ||
|
|
||
| impl FlowNode for Node { | ||
| type Request = Request; | ||
|
|
||
| fn imports(ctx: &mut ImportCtx<'_>) { | ||
| ctx.import::<gen_cargo_nextest_run_cmd::Node>(); | ||
| } | ||
|
|
||
| fn emit(requests: Vec<Request>, ctx: &mut NodeCtx<'_>) -> anyhow::Result<()> { | ||
| for Request { | ||
| run_kind_deps, | ||
| working_dir, | ||
| config_file, | ||
| nextest_profile, | ||
| nextest_filter_expr, | ||
| extra_env, | ||
| command: list_cmd, | ||
| } in requests | ||
| { | ||
| if let gen_cargo_nextest_run_cmd::RunKindDeps::BuildAndRun { | ||
| params: _, | ||
| nextest_installed: _, | ||
| rust_toolchain: _, | ||
| cargo_flags: _, | ||
| } = run_kind_deps | ||
| { | ||
| anyhow::bail!("BuildAndRun is not supported.") | ||
damanm24 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| let run_cmd = ctx.reqv(|v| gen_cargo_nextest_run_cmd::Request { | ||
| run_kind_deps, | ||
| working_dir, | ||
| config_file, | ||
| tool_config_files: Vec::new(), // Ignored | ||
| nextest_profile, | ||
| extra_env, | ||
| nextest_filter_expr, | ||
| run_ignored: true, | ||
| fail_fast: None, | ||
| portable: false, | ||
| command: v, | ||
| }); | ||
|
|
||
| ctx.emit_rust_step("generate nextest list command", |ctx| { | ||
| let run_cmd = run_cmd.claim(ctx); | ||
| let list_cmd = list_cmd.claim(ctx); | ||
| move |rt| { | ||
| let mut cmd = rt.read(run_cmd); | ||
| cmd.args = cmd | ||
| .args | ||
| .into_iter() | ||
| .map(|arg| if arg == "run" { "list".into() } else { arg }) | ||
| .collect(); | ||
| cmd.args.extend(["--message-format".into(), "json".into()]); | ||
|
|
||
| rt.write(list_cmd, &cmd); | ||
| log::info!("Generated command: {}", cmd); | ||
|
|
||
| Ok(()) | ||
| } | ||
| }); | ||
| } | ||
| Ok(()) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.