diff --git a/.github/workflows/load_tests.yaml b/.github/workflows/load_tests.yaml index 076dd5459..8b4cbea8c 100644 --- a/.github/workflows/load_tests.yaml +++ b/.github/workflows/load_tests.yaml @@ -225,7 +225,6 @@ jobs: if: ${{ env.SKIP_TESTS != 'true' }} continue-on-error: true # if this fails, we still need to run clean-up steps run: | - echo $UPDATED_FOLDERS mkdir $HOME/.gen3 poetry run python -m gen3_ci.scripts.prepare_ci_environment if [ $? -ne 0 ]; then diff --git a/.github/workflows/shared_integration_tests.yaml b/.github/workflows/shared_integration_tests.yaml index a10f137bb..c07fc8d37 100644 --- a/.github/workflows/shared_integration_tests.yaml +++ b/.github/workflows/shared_integration_tests.yaml @@ -330,8 +330,8 @@ jobs: continue-on-error: true # if this fails, we still need to run clean-up steps run: | PR_FILES=$(gh api repos/$REPO_FN/pulls/$PR_NUM/files --jq '.[].filename') - UPDATED_FOLDERS=$(echo "$PR_FILES" | grep -v "^.github/" | awk -F'/' '{if ($1 != ".github" && NF > 1) print $1"/"$2}' | sort -u | tr '\n' ',' | sed 's/,$//') - echo "UPDATED_FOLDERS=$UPDATED_FOLDERS" >> $GITHUB_ENV + SOURCE_CONFIG=$(echo "$PR_FILES" | grep -v "^.github/" | awk -F'/' '{if ($1 != ".github" && NF > 1) print $1"/"$2}' | sort -u | tr '\n' ',' | sed 's/,$//') + echo "SOURCE_CONFIG=$SOURCE_CONFIG" >> $GITHUB_ENV # Apply the changes to the manifest of the selected CI environment, roll the pods and run usersync # Generate API keys for test users for the environment @@ -340,7 +340,7 @@ jobs: if: ${{ env.SKIP_TESTS != 'true' && (steps.create_ns.outcome == 'success' || steps.select_ci_env.outcome == 'success') }} continue-on-error: true # if this fails, we still need to run clean-up steps run: | - echo $UPDATED_FOLDERS + echo $SOURCE_CONFIG mkdir $HOME/.gen3 mkdir logs echo "****** Prepare CI Environment ******" > logs/gh_action_logs.txt diff --git a/gen3-integration-tests/gen3_ci/scripts/prepare_ci_environment.py b/gen3-integration-tests/gen3_ci/scripts/prepare_ci_environment.py index d31ef4dcb..43f5d4893 100644 --- a/gen3-integration-tests/gen3_ci/scripts/prepare_ci_environment.py +++ b/gen3-integration-tests/gen3_ci/scripts/prepare_ci_environment.py @@ -180,7 +180,7 @@ def prepare_ci_environment(namespace): result = modify_env_for_test_repo_pr(namespace) assert result.lower() == "success" elif repo in ("cdis-manifest", "gitops-qa", "gen3-gitops"): # Manifest repos - updated_folders = os.getenv("UPDATED_FOLDERS", "").split(",") + updated_folders = os.getenv("SOURCE_CONFIG", "").split(",") updated_folder = updated_folders[0] if updated_folders else "" if len(updated_folders) == 1 and updated_folders[0] == "": logger.info("No folders were updated. Skipping tests...") diff --git a/gen3-integration-tests/gen3_ci/scripts/setup_ci_env.sh b/gen3-integration-tests/gen3_ci/scripts/setup_ci_env.sh index 7a0b02789..21a4bba72 100755 --- a/gen3-integration-tests/gen3_ci/scripts/setup_ci_env.sh +++ b/gen3-integration-tests/gen3_ci/scripts/setup_ci_env.sh @@ -154,7 +154,7 @@ elif [ "$setup_type" == "manifest-env-setup" ]; then portal_custom_config_enabled=$(yq eval '.portal.customConfig.enabled == true' "$new_manifest_values_file_path") if [[ "$portal_custom_config_enabled" == "true" ]]; then echo "Found customConfig enabled for Portal. Updating repo and branch..." - yq eval '.portal.customConfig.dir = strenv(UPDATED_FOLDERS) + "/values/portal/"' -i "$ci_default_manifest_values_yaml" + yq eval '.portal.customConfig.dir = strenv(SOURCE_CONFIG) + "/values/portal/"' -i "$ci_default_manifest_values_yaml" yq eval '.portal.customConfig.repo = "https://github.com/" + strenv(REPO_FN) + ".git"' -i "$ci_default_manifest_values_yaml" yq eval '.portal.customConfig.branch = strenv(BRANCH)' -i "$ci_default_manifest_values_yaml" else @@ -314,7 +314,7 @@ elif [ "$setup_type" == "manifest-env-setup" ]; then fi # This is to make sure any changes for ci/default are run with portal for now - if [[ $UPDATED_FOLDERS == "ci/default" ]]; then + if [[ $SOURCE_CONFIG == "ci/default" ]]; then echo "Current change is in ci/default, removing frontend-framework config" yq eval "del(.frontend-framework)" -i $ci_default_manifest_values_yaml fi @@ -482,8 +482,9 @@ fi # For test-env-pr and service-env-setup we set CI_ENV flag to gen3ff for frontend-framework +# For manifest-env-setup where target manifest is also ci/default, we will use portal and switch in future # so env doesnt need portal configuration -if [[ "$setup_type" == "test-env-setup" || "$setup_type" == "service-env-setup" ]]; then +if [[ "$setup_type" == "test-env-setup" || "$setup_type" == "service-env-setup" || ("$setup_type" == "manifest-env-setup" && "$SOURCE_CONFIG" == "ci/default") ]]; then if [[ "$CI_ENV" == "gen3ff" ]]; then yq eval 'del(.portal)' --inplace "$ci_default_manifest_values_yaml" yq eval '.global.frontendRoot = "gen3ff"' --inplace "$ci_default_manifest_values_yaml" diff --git a/gen3-integration-tests/tests/test_data_upload.py b/gen3-integration-tests/tests/test_data_upload.py index 4fbe8a8c1..a54bce843 100644 --- a/gen3-integration-tests/tests/test_data_upload.py +++ b/gen3-integration-tests/tests/test_data_upload.py @@ -600,7 +600,7 @@ def test_failed_multipart_upload(self): @pytest.mark.frontend @pytest.mark.skipif( - "midrc" in os.getenv("UPDATED_FOLDERS", "") or "midrc" in pytest.hostname, + "midrc" in os.getenv("SOURCE_CONFIG", "") or "midrc" in pytest.hostname, reason="data upload UI test cases don't work in midrc environment", ) # TODO: GFF - Remove once submission page functionality is implemented @@ -671,7 +671,7 @@ def test_map_uploaded_files_in_submission_page(self, page: Page): reason="Submission Page functionality is not implemented in frontend-framework", ) @pytest.mark.skipif( - "midrc" in os.getenv("UPDATED_FOLDERS", "") or "midrc" in pytest.hostname, + "midrc" in os.getenv("SOURCE_CONFIG", "") or "midrc" in pytest.hostname, reason="data upload UI test cases don't work in midrc environment", ) def test_cannot_see_files_uploaded_by_other_users(self, page: Page):