Skip to content

Commit

Permalink
tests: grafted groups already work
Browse files Browse the repository at this point in the history
Add a test to demonstrate the ability to query
for grafted groups.

Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information
davvid committed Jul 4, 2023
1 parent 85fb376 commit 813e626
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/data/grafts/graft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ variables:
example_url: ${repos}/example.git

groups:
core:
- deps::framework
- core
prebuilt-group:
- prebuilt
- prebuilt2

trees:
graft: ${example_url}
core: ${repos}/core.git
prebuilt:
path: trees/prebuilt
prebuilt2:
path: trees/prebuilt
20 changes: 20 additions & 0 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,26 @@ fn cmd_exec_garden_with_grafted_trees() {
}
}

/// Test the use of graft:: tree references when querying for groups.
#[test]
fn cmd_exec_grafted_group() {
// prebuilt-group has two trees pointing to the same prebuilt path.
let output = garden_capture(&[
"--quiet",
"--chdir",
"tests/data",
"exec",
"graft::prebuilt-group",
"pwd",
]);
let output_len = output.lines().count();
assert_eq!(output_len, 2);

for line in output.lines() {
assert!(line.ends_with("/tests/data/trees/prebuilt"));
}
}

/// Test the use of $shell variables in commands.
/// $shell variables are not expanded by garden.
/// ${garden} variables are expanded.
Expand Down

0 comments on commit 813e626

Please sign in to comment.