From 339f64b15e6584e85050d40c4ce768ced2486d00 Mon Sep 17 00:00:00 2001 From: Bill Glesias Date: Tue, 2 Apr 2024 10:14:51 -0400 Subject: [PATCH] chore: reduce flake in windows-run-app-integration-tests-chrome by not testing certain tests that are flaky inside the pap-integration cy-in-cy pipeline. Because there are issues recording with --spec specified with cy-in-cy, we will not be recording the windows app integration tests. Additionally, this fixes the windows-test-binary-against-kitchensink-chrome where yarn is not installed on the windows-server executor by making sure yarn is installed first before any action happens when checking out a repo [run ci] (#29198) --- .circleci/cache-version.txt | 2 +- .circleci/workflows.yml | 44 ++++++++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/.circleci/cache-version.txt b/.circleci/cache-version.txt index 9f0fa2d7a673..8ecd44e897cf 100644 --- a/.circleci/cache-version.txt +++ b/.circleci/cache-version.txt @@ -1,3 +1,3 @@ # Bump this version to force CI to re-create the cache from scratch. -03-12-24 +03-25-24 diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index cf488a610b3b..2f5294e5c180 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -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 >> @@ -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: @@ -666,6 +666,11 @@ commands: browser: <> - run: command: | + if [[ $PLATFORM == 'windows' && '<>' == 'chrome' && '<>' == 'app' && '<>' == '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 @@ -675,14 +680,23 @@ commands: fi # internal PR cmd=$([[ <> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true - 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/<> cypress:run:<> --browser <> --record --parallel --group <>-<> + + 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/<> && /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/<> cypress:run:<> --browser <> --spec $TESTFILES + else + 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/<> cypress:run:<> --browser <> --record --parallel --group <>-<> + fi else # external PR @@ -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 + 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/<> && /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=<> \ CYPRESS_CONFIG_ENV=production \ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \ @@ -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: <> pull_request_id: <>