diff --git a/.github/workflows/ci-test-custom-script.yml b/.github/workflows/ci-test-custom-script.yml index 5823f4df90..97d27954ec 100644 --- a/.github/workflows/ci-test-custom-script.yml +++ b/.github/workflows/ci-test-custom-script.yml @@ -92,7 +92,7 @@ jobs: uses: actions/download-artifact@v3 with: name: failed_spec_ci - path: ~/ + path: ~/failed_spec_ci # failed_spec_env will contain list of all failed specs # We are using environment variable instead of regular to support multiline @@ -101,13 +101,15 @@ jobs: if: steps.run_result.outputs.run_result == 'failedtest' working-directory: app/client run: | - echo "failed_spec_env=" >> $GITHUB_ENV + failed_spec_env="" while IFS= read -r line do spec_name=$(echo $line | awk -F'/' '{print $NF}') failed_spec=$(find . -name $spec_name | sed 's|./||') - echo "failed_spec_env=${{ env.failed_spec_env }},$failed_spec" >> $GITHUB_ENV + failed_spec_env="$failed_spec_env,$failed_spec" done < ~/failed_spec_ci/failed_spec_ci-${{ matrix.job }} + failed_spec_env=${failed_spec_env#,} + echo "failed_spec_env=$failed_spec_env" >> $GITHUB_ENV - if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest' run: echo "Starting full run" && exit 0 @@ -235,48 +237,6 @@ jobs: - run: | echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV - # - name: Set Pull Request Title - # env: - # EVENT_COMMITS: ${{ toJson(github.event.commits[0].message) }} - # run: | - # echo "${{ env.EVENT_COMMITS }}" | awk -F '\\\\n' '{print $1}' - - - name: Save Git values - # pass env variables from this step to other steps - # using GitHub Actions environment file - # https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#environment-files - run: | - PR_NUMBER=${{ inputs.pr }} - echo COMMIT_INFO_BRANCH=$(git rev-parse --abbrev-ref HEAD) >> $GITHUB_ENV - echo COMMIT_INFO_MESSAGE=OkToTest run on PR# ${{ inputs.pr }} >> $GITHUB_ENV - echo COMMIT_INFO_EMAIL=$(git show -s --pretty=%ae) >> $GITHUB_ENV - echo COMMIT_INFO_AUTHOR=$(git show -s --pretty=%an) >> $GITHUB_ENV - echo COMMIT_INFO_SHA=$(git show -s --pretty=%H) >> $GITHUB_ENV - echo COMMIT_INFO_TIMESTAMP=$(git show -s --pretty=%ct) >> $GITHUB_ENV - echo COMMIT_INFO_REMOTE=$(git config --get remote.origin.url) >> $GITHUB_ENV - # delete the .git folder afterwords to use the environment values - rm -rf .git - - - name: Show Git values - run: | - echo Branch $COMMIT_INFO_BRANCH - echo Message $COMMIT_INFO_MESSAGE - echo Email $COMMIT_INFO_EMAIL - echo Author $COMMIT_INFO_AUTHOR - echo SHA $COMMIT_INFO_SHA - echo Timestamp $COMMIT_INFO_TIMESTAMP - echo Remote $COMMIT_INFO_REMOTE - - - name: Set Commit Message - env: - EVENT_COMMITS: ${{ toJson(github.event.commits[0].message) }} - run: | - if [[ ${{ inputs.pr }} -ne 0 ]]; then - echo "COMMIT_INFO_MESSAGE=${{ env.COMMIT_INFO_MESSAGE }}" >> $GITHUB_ENV - else - echo "COMMIT_INFO_MESSAGE=$(echo \"${{ env.EVENT_COMMITS }}\" | awk -F '\\\\n' '{print $1}' | sed 's/^\"//')" >> $GITHUB_ENV - fi - - name: Run the cypress test if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest' id: cypress_test @@ -323,8 +283,8 @@ jobs: APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }} COMMIT_INFO_MESSAGE: ${{ env.COMMIT_INFO_MESSAGE }} CYPRESS_VERIFY_TIMEOUT: 100000 - TOTAL_RUNNERS: 60 - THIS_RUNNER: ${{ matrix.job }} + TOTAL_RUNNERS: ${{ strategy.job-total }} + THIS_RUNNER: ${{ strategy.job-index }} CYPRESS_SPEC_PATTERN: "cypress/e2e/**/**/*" CYPRESS_ENV: "NODE_ENV=development" CYPRESS_CONFIG_FILE: cypress_ci_custom.config.ts @@ -335,24 +295,6 @@ jobs: working-directory: app/client command: yarn ts-node --require esm cypress/cypress-split.ts - # - name: Retrieve Retry Attempt Count - # run: | - # retry_count=$((GITHUB_RUN_NUMBER - 1)) - # echo "Retry attempt count: $retry_count" >> $GITHUB_OUTPUT - - # - name: Save Git values for Retry - # run: | - # PR_NUMBER=${{ inputs.pr }} - # echo COMMIT_INFO_MESSAGE=Retry-${{ env.retry_count }} of OkToTest on PR# ${{ inputs.pr }} >> $GITHUB_ENV - - # - name: Set Re-try Commit Message - # run: | - # if [[ ${{ inputs.pr }} -ne 0 ]]; then - # echo "COMMIT_INFO_MESSAGE=${{ env.COMMIT_INFO_MESSAGE }}" >> $GITHUB_ENV - # else - # echo "COMMIT_INFO_MESSAGE=Retry-${{ env.retry_count }} of Merge on PR# ${{ inputs.pr }}" >> $GITHUB_ENV - # fi - # In case of second attempt only run failed specs - name: Run the cypress test with failed tests if: steps.run_result.outputs.run_result == 'failedtest' diff --git a/app/client/cypress_ci_custom.config.ts b/app/client/cypress_ci_custom.config.ts index 098d82076b..2b1bedc8da 100644 --- a/app/client/cypress_ci_custom.config.ts +++ b/app/client/cypress_ci_custom.config.ts @@ -7,8 +7,6 @@ export default defineConfig({ responseTimeout: 60000, pageLoadTimeout: 60000, videoUploadOnPasses: false, - screenshotsFolder: "screenshots", - videoCompression: 5, numTestsKeptInMemory: 5, experimentalMemoryManagement: true, reporter: "cypress-mochawesome-reporter",