Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reduce flake in windows-run-app-integration-tests-chrome #29198

Merged
merged 1 commit into from
Apr 2, 2024
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
2 changes: 1 addition & 1 deletion .circleci/cache-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Bump this version to force CI to re-create the cache from scratch.

03-12-24
03-25-24
44 changes: 34 additions & 10 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ 'cacie/dep/electron-27', << pipeline.git.branch >> ]
- equal: [ 'feat/protocol_shadow_dom_support', << pipeline.git.branch >> ]
- equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ]
- equal: [ 'mschile/mochaEvents_win_sep', << pipeline.git.branch >> ]
- equal: [ 'chore/reduce_windows_flake', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -125,7 +125,7 @@ executors:
# https://circleci.com/docs/2.0/hello-world-windows/#software-pre-installed-in-the-windows-image
windows: &windows-executor
machine:
image: windows-server-2019-vs2019:stable
image: windows-server-2022-gui:stable
shell: bash.exe -eo pipefail
resource_class: windows.large
environment:
Expand Down Expand Up @@ -666,6 +666,11 @@ commands:
browser: <<parameters.browser>>
- run:
command: |
if [[ $PLATFORM == 'windows' && '<<parameters.browser>>' == 'chrome' && '<<parameters.package>>' == 'app' && '<<parameters.type>>' == 'e2e' ]]; then
IS_WINDOWS_APP_INTEGRATION_TEST=true
else
IS_WINDOWS_APP_INTEGRATION_TEST=false
fi
echo Current working directory is $PWD
echo Total containers $CIRCLE_NODE_TOTAL

Expand All @@ -675,14 +680,23 @@ commands:
fi
# internal PR
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
DEBUG=<<parameters.debug>> \
CYPRESS_CONFIG_ENV=production \
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
CYPRESS_INTERNAL_ENABLE_TELEMETRY="true" \
$cmd yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>

if [[ "$IS_WINDOWS_APP_INTEGRATION_TEST" = true ]]; then
echo "on windows running app-integration tests. Skipping flaky tests"
# if windows app integration tests, skip some very flaky tests that fail to load for undetermined reasons
TESTFILES=$(cd packages/<<parameters.package>> && /usr/bin/find cypress/e2e -regextype posix-extended -name '*.cy.*' -not -regex '.*(experimentalRetries|reporter.command_errors|ct-framework-errors|reporter-ct-vite|reporter-ct-webpack|reporter.errors|reporter.hooks|cypress-in-cypress|runner.ui|specs|studio).*' | circleci tests split --total=$CIRCLE_NODE_TOTAL)
# Do NOT record on windows packages/app due to encryption issues
$cmd yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --spec $TESTFILES
else
DEBUG=<<parameters.debug>> \
CYPRESS_CONFIG_ENV=production \
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
CYPRESS_INTERNAL_ENABLE_TELEMETRY="true" \
$cmd yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
fi
else
# external PR

Expand All @@ -703,6 +717,12 @@ commands:
# To run the `yarn` command, we need to walk out of the package folder.
cd ../..

if [[ "$IS_WINDOWS_APP_INTEGRATION_TEST" = true ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we detect host os in the specs themselves, to ease tracking down why these tests are skipped in the future?

e.g.,

;(isWindowsHostCI ? describe.skip : describe)('top level describe block', function () { })

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to skip them on the OS itself though. Only in CI on a specific OS for a given test. They don't flake locally or have issues.

echo "on windows running app-integration tests. Skipping flaky tests"
# if windows app integration tests, skip some very flaky tests that fail to load for undetermined reasons
TESTFILES=$(cd packages/<<parameters.package>> && /usr/bin/find cypress/e2e -regextype posix-extended -name '*.cy.*' -not -regex '.*(experimentalRetries|reporter.command_errors|ct-framework-errors|reporter-ct-vite|reporter-ct-webpack|reporter.errors|reporter.hooks|cypress-in-cypress|runner.ui|specs|studio).*' | circleci tests split --total=$CIRCLE_NODE_TOTAL)
fi

DEBUG=<<parameters.debug>> \
CYPRESS_CONFIG_ENV=production \
PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
Expand Down Expand Up @@ -1010,6 +1030,10 @@ commands:
type: string
default: "npm start --if-present"
steps:
- run:
name: Install yarn if not already installed
command: |
yarn --version || npm i -g yarn
- clone-repo-and-checkout-branch:
repo: <<parameters.repo>>
pull_request_id: <<parameters.pull_request_id>>
Expand Down
Loading