From fefff5941f3768d363987f97eac4a90bafb0e01b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 5 Nov 2020 11:09:48 -0800 Subject: [PATCH] Justfile: Use local policy engine in e2e-fixtures-capture-only 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. --- Justfile | 4 +--- e2e/tests/e2e.rs | 5 ++--- ...2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_amd64.json} | 0 ...2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_s390x.json} | 0 ...2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_amd64.json} | 0 ...2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_s390x.json} | 0 6 files changed, 3 insertions(+), 6 deletions(-) rename e2e/tests/testdata/{b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_amd64-production.json => b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_amd64.json} (100%) rename e2e/tests/testdata/{b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_s390x-production.json => b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_s390x.json} (100%) rename e2e/tests/testdata/{b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_amd64-production.json => b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_amd64.json} (100%) rename e2e/tests/testdata/{b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_s390x-production.json => b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_s390x.json} (100%) diff --git a/Justfile b/Justfile index 6334119c1..2a913f899 100644 --- a/Justfile +++ b/Justfile @@ -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 diff --git a/e2e/tests/e2e.rs b/e2e/tests/e2e.rs index 0ac8378ab..2d8cca482 100644 --- a/e2e/tests/e2e.rs +++ b/e2e/tests/e2e.rs @@ -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)) diff --git a/e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_amd64-production.json b/e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_amd64.json similarity index 100% rename from e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_amd64-production.json rename to e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_amd64.json diff --git a/e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_s390x-production.json b/e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_s390x.json similarity index 100% rename from e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_s390x-production.json rename to e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.2_s390x.json diff --git a/e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_amd64-production.json b/e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_amd64.json similarity index 100% rename from e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_amd64-production.json rename to e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_amd64.json diff --git a/e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_s390x-production.json b/e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_s390x.json similarity index 100% rename from e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_s390x-production.json rename to e2e/tests/testdata/b87e7c2782837a3538b0aa3dceb9e8133765ec81_stable-4.3_s390x.json