From 5124bdc73671a07bfb423935fa98e02e0369bf4e Mon Sep 17 00:00:00 2001 From: Bella Luz Quintero Date: Tue, 7 Jan 2025 12:27:18 -0700 Subject: [PATCH] rename file path variable to be specifc to rse2e --- .github/workflows/automated-staging-test-run.yml | 2 +- .github/workflows/golden-copy-staging-test-run.yml | 2 +- .github/workflows/staging-test-run_reusable.yml | 4 ++-- examples/Test/Automated/GoldenCopy/README.md | 2 +- generate_env.sh | 2 +- .../rse2e/external/azure/AzureBlobFileFetcher.java | 5 +++-- .../rse2e/external/localfile/LocalFileFetcher.java | 9 +++++---- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/automated-staging-test-run.yml b/.github/workflows/automated-staging-test-run.yml index 2027aa78f..e8e142fbc 100644 --- a/.github/workflows/automated-staging-test-run.yml +++ b/.github/workflows/automated-staging-test-run.yml @@ -9,7 +9,7 @@ jobs: call-staging-test-run: uses: ./.github/workflows/staging-test-run_reusable.yml with: - FILE_PATH: '../examples/Test/Automated/Assertion/' + RSE2E_LOCAL_INPUT_FILE_PATH: '../examples/Test/Automated/Assertion/' NAME: 'Automated' TEST_TYPE: 'automatedTest' secrets: inherit # pragma: allowlist secret diff --git a/.github/workflows/golden-copy-staging-test-run.yml b/.github/workflows/golden-copy-staging-test-run.yml index 934215027..45e328669 100644 --- a/.github/workflows/golden-copy-staging-test-run.yml +++ b/.github/workflows/golden-copy-staging-test-run.yml @@ -10,7 +10,7 @@ jobs: call-staging-test-run: uses: ./.github/workflows/staging-test-run_reusable.yml with: - FILE_PATH: '../examples/Test/Automated/GoldenCopy/Expected/' + RSE2E_LOCAL_INPUT_FILE_PATH: '../examples/Test/Automated/GoldenCopy/Expected/' NAME: 'Golden Copy' TEST_TYPE: 'goldenCopyTest' secrets: inherit # pragma: allowlist secret diff --git a/.github/workflows/staging-test-run_reusable.yml b/.github/workflows/staging-test-run_reusable.yml index 18b847ea8..8194cc50c 100644 --- a/.github/workflows/staging-test-run_reusable.yml +++ b/.github/workflows/staging-test-run_reusable.yml @@ -13,7 +13,7 @@ on: description: The name of test required: true default: 'Automated' - FILE_PATH: + RSE2E_LOCAL_INPUT_FILE_PATH: type: string description: The path to local files required: true @@ -35,7 +35,7 @@ jobs: - name: Run automated tests env: AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AUTOMATED_TEST_AZURE_STORAGE_CONNECTION_STRING }} - LOCAL_FILE_PATH: ${{ inputs.FILE_PATH }} + RSE2E_LOCAL_INPUT_FILE_PATH: ${{ inputs.RSE2E_LOCAL_INPUT_FILE_PATH }} run: | ./gradlew rs-e2e:clean rs-e2e:${{ inputs.TEST_TYPE }} diff --git a/examples/Test/Automated/GoldenCopy/README.md b/examples/Test/Automated/GoldenCopy/README.md index afbb225af..aabb63058 100644 --- a/examples/Test/Automated/GoldenCopy/README.md +++ b/examples/Test/Automated/GoldenCopy/README.md @@ -20,5 +20,5 @@ The files are required to: Setup Environment Variable: - In generate_env.sh: - - Change `LOCAL_FILE_PATH` to actual /Input path + - Change `RSE2E_LOCAL_INPUT_FILE_PATH` to actual /Input path - Run generate_env.sh diff --git a/generate_env.sh b/generate_env.sh index 648a08a61..1a641bbeb 100755 --- a/generate_env.sh +++ b/generate_env.sh @@ -15,7 +15,7 @@ DB_NAME=intermediary DB_USER=intermediary DB_PASS=changeIT! DB_SSL=require -LOCAL_FILE_PATH=~/trusted-intermediary/examples/Test/Automated/Assertion" +RSE2E_LOCAL_INPUT_FILE_PATH=~/trusted-intermediary/examples/Test/Automated/Assertion" # Get directory of script file script_dir="$(dirname "$0")" diff --git a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobFileFetcher.java b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobFileFetcher.java index edae1f246..a373cd824 100644 --- a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobFileFetcher.java +++ b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobFileFetcher.java @@ -52,9 +52,10 @@ public static FileFetcher getInstance() { // TODO - we need to modify the guts to only grab the golden or automated path @Override public List fetchFiles() { - String files_path = System.getenv("LOCAL_FILE_PATH"); + String files_path = System.getenv("RSE2E_LOCAL_INPUT_FILE_PATH"); if (files_path == null || files_path.isEmpty()) { - throw new IllegalArgumentException("Environment variable LOCAL_FILE_PATH is not set"); + throw new IllegalArgumentException( + "Environment variable RSE2E_LOCAL_INPUT_FILE_PATH is not set"); } List relevantFiles = new ArrayList<>(); diff --git a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/localfile/LocalFileFetcher.java b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/localfile/LocalFileFetcher.java index 97237db8d..ef9c9767d 100644 --- a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/localfile/LocalFileFetcher.java +++ b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/localfile/LocalFileFetcher.java @@ -27,11 +27,12 @@ public static FileFetcher getInstance() { @Override public List fetchFiles() { - String files_path = System.getenv("LOCAL_FILE_PATH"); - if (files_path == null || files_path.isEmpty()) { - throw new IllegalArgumentException("Environment variable LOCAL_FILE_PATH is not set"); + String rse2ELocalInputFilePath = System.getenv("RSE2E_LOCAL_INPUT_FILE_PATH"); + if (rse2ELocalInputFilePath == null || rse2ELocalInputFilePath.isEmpty()) { + throw new IllegalArgumentException( + "Environment variable RSE2E_LOCAL_INPUT_FILE_PATH is not set"); } - try (Stream stream = Files.walk(Paths.get(files_path))) { + try (Stream stream = Files.walk(Paths.get(rse2ELocalInputFilePath))) { return stream.filter(Files::isRegularFile) .filter(path -> path.toString().endsWith(EXTENSION)) .map(