Skip to content

Commit

Permalink
Justfile: Use local policy engine in e2e-fixtures-capture-only
Browse files Browse the repository at this point in the history
Dropping the production suffix.  I don't really care where the fixture
data comes from, but get-graph-pe-staging and get-graph-pe-production
will only be serving a single graph-data commit at once.  Using
get-graph-pe instead will make it easier for folks to use this
Justfile to get graph dumps based on arbitrary graph-data commits
which they have fed into their local graph builder to be consumed by
their local policy engine.  With this change, generating new fixtures
should work like:

  $ echo "${GRAPH_DATA_COMMIT_HASH}" >e2e/tests/testdata/metadata_revision
  $ just run-graph-builder-e2e &
  $ just just run-policy-engine &
  $ just e2e-fixtures-capture-only
  $ killall just

Also rename our current fixtures to match the new, suffix-less
pattern, and update the e2e suite to no longer require the suffix.
  • Loading branch information
wking committed Nov 5, 2020
1 parent c6f3512 commit fefff59
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ e2e-fixtures-capture-only:
for base in "stable"; do
for version in "4.2" "4.3"; do
for arch in "amd64" "s390x"; do
for suffix in "-production"; do
just get-graph-pe"${suffix}" "${base}-${version}" "${arch}" | hack/graph-normalize.sh > {{testdata_dir}}/"$(just metadata_reference_revision)_${base}-${version}_${arch}${suffix}".json
done
just get-graph-pe "${base}-${version}" "${arch}" | hack/graph-normalize.sh > {{testdata_dir}}/"$(just metadata_reference_revision)_${base}-${version}_${arch}".json
done
done
done
Expand Down
5 changes: 2 additions & 3 deletions e2e/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ lazy_static::lazy_static! {
#[test_case("stable-4.3", "amd64")]
#[test_case("stable-4.3", "s390x")]
fn e2e_channel_success(channel: &'static str, arch: &'static str) {
let file_suffix = "-production";
let testdata_path = format!(
"{}/{}_{}_{}{}.json",
*TESTDATA_DIR, *METADATA_REVISION, channel, arch, file_suffix,
"{}/{}_{}_{}.json",
*TESTDATA_DIR, *METADATA_REVISION, channel, arch,
);
let testdata = &std::fs::read_to_string(&testdata_path)
.context(format!("reading {}", &testdata_path))
Expand Down

0 comments on commit fefff59

Please sign in to comment.