Skip to content

Commit

Permalink
rename file path variable to be specifc to rse2e
Browse files Browse the repository at this point in the history
  • Loading branch information
pluckyswan committed Jan 7, 2025
1 parent 2e34325 commit 5124bdc
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automated-staging-test-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/golden-copy-staging-test-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/staging-test-run_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion examples/Test/Automated/GoldenCopy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion generate_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<HL7FileStream> 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<HL7FileStream> relevantFiles = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ public static FileFetcher getInstance() {

@Override
public List<HL7FileStream> 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<Path> stream = Files.walk(Paths.get(files_path))) {
try (Stream<Path> stream = Files.walk(Paths.get(rse2ELocalInputFilePath))) {
return stream.filter(Files::isRegularFile)
.filter(path -> path.toString().endsWith(EXTENSION))
.map(
Expand Down

0 comments on commit 5124bdc

Please sign in to comment.