diff --git a/.github/workflows/ci-test-limited-with-count.yml b/.github/workflows/ci-test-limited-with-count.yml index 373715c905..bd16b8f868 100644 --- a/.github/workflows/ci-test-limited-with-count.yml +++ b/.github/workflows/ci-test-limited-with-count.yml @@ -144,35 +144,47 @@ jobs: # Step to get specs from the file or use the provided specs - name: Get specs to run run: | - # Check if specs_to_run is provided; if not, use the fallback file - echo "[DEBUG] Initial specs_to_run value: $specs_to_run" - if [[ -z "$specs_to_run" || "$specs_to_run" == "no_data" ]]; then - echo "[INFO] No specs provided, falling back to limited-tests.txt file." - - # Verify if the fallback file exists - if [[ ! -f app/client/cypress/limited-tests.txt ]]; then - echo "[ERROR] limited-tests.txt file not found in app/client/cypress!" >&2 - exit 1 - else - echo "[DEBUG] limited-tests.txt file found. Proceeding to read specs." - fi + ls -l + echo "[DEBUG] Checking inputs.specs_to_run: '${{ inputs.specs_to_run }}'" + echo "[DEBUG] Checking github.event.inputs.specs_to_run: '${{ github.event.inputs.specs_to_run }}'" + + # Determine the source of the specs_to_run input + if [[ -n "${{ inputs.specs_to_run }}" ]]; then + specs_to_run="${{ inputs.specs_to_run }}" # For workflow_call + echo "[INFO] specs_to_run provided via workflow_call: $specs_to_run" + elif [[ -n "${{ github.event.inputs.specs_to_run }}" ]]; then + specs_to_run="${{ github.event.inputs.specs_to_run }}" # For workflow_dispatch + echo "[INFO] specs_to_run provided via workflow_dispatch: $specs_to_run" + else + specs_to_run="" + echo "[INFO] No specs provided. Falling back to limited-tests.txt." + fi + # Check if specs_to_run is provided; if not, use the fallback file + echo "[DEBUG] Initial specs_to_run value: '$specs_to_run'" + + if [[ "$specs_to_run" == *"no_data"* || -z "$specs_to_run" || "$specs_to_run" == "" ]]; then + echo "[INFO] No specs provided or 'no_data' detected, falling back to limited-tests.txt file." + + # Verify if the fallback file exists + limited_tests_file="${{ github.workspace }}/app/client/cypress/limited-tests.txt" + ls -l ${{ github.workspace }}/app/client/cypress/limited-tests.txt + cat ${{ github.workspace }}/app/client/cypress/limited-tests.txt specs_to_run="" # Read each line of limited-tests.txt while IFS= read -r line || [[ -n "$line" ]]; do - # Log each line being read - echo "[DEBUG] Reading line: $line" + echo "[DEBUG] Read line: '$line'" # Skip comments and empty lines if [[ $line =~ ^#|^\/\/ || -z $line ]]; then - echo "[DEBUG] Skipping comment/empty line: $line" + echo "[DEBUG] Skipped line: '$line'" # Indicate skipped lines continue - else - echo "[DEBUG] Adding spec to specs_to_run: $line" - specs_to_run="$specs_to_run,$line" fi - done < app/client/cypress/limited-tests.txt + + # Add the line to specs_to_run + specs_to_run="$specs_to_run,$line" + done < ${{ github.workspace }}/app/client/cypress/limited-tests.txt # Remove leading comma specs_to_run=${specs_to_run#,} @@ -187,10 +199,8 @@ jobs: echo "[INFO] Using provided specs: $specs_to_run" fi - # Log the final specs_to_run value before writing it to GitHub environment + # Log the final specs_to_run value echo "[DEBUG] Setting specs_to_run to GitHub environment variable: $specs_to_run" - - # Set the final specs_to_run to GitHub environment variable echo "specs_to_run=$specs_to_run" >> $GITHUB_ENV