Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/load_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/shared_integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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...")
Expand Down
7 changes: 4 additions & 3 deletions gen3-integration-tests/gen3_ci/scripts/setup_ci_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions gen3-integration-tests/tests/test_data_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
Loading