ci: Changes to enable rerun with custom script (#25480)

## Description
- Changes to enable rerun with custom script
#### Type of change
- Workflow file changes
## Testing
>
#### How Has This Been Tested?
 - Workflow run
## Checklist:
#### Dev activity
#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
This commit is contained in:
Saroj 2023-07-19 17:02:24 +05:30 committed by GitHub
parent 3313cdadc0
commit 07dc6ee9ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 67 deletions

View File

@ -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'

View File

@ -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",