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: skip binary jobs if we don't have a circle token #27876

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

astone123
Copy link
Contributor

@astone123 astone123 commented Sep 21, 2023

I recently updated the contributor workflow to block jobs that require a restricted CircleCI context with an approval job. This works, but when the jobs are started after approval, they still don't have the environment variables from the contexts.

This makes it so that we can't build the linux binaries during contributor workflows, because in order to do that, we would need the CIRCLE_TOKEN variable from the restricted contexts.

This PR adds logic to skip building the binary and skip all binary tests if CIRCLE_TOKEN is not in the environment (this will happen on every contributor PR, regardless of who pushes the commit that is running in CI). This way, we can actually get a passing build on contributor PRs if all other steps pass.

@astone123 astone123 self-assigned this Sep 21, 2023
@@ -593,7 +603,7 @@ commands:
if [[ <<parameters.type>> == 'ct' ]]; then
# component tests are located side by side with the source codes.
# for the app component tests, ignore specs that are known to cause failures on contributor PRs (see https://discuss.circleci.com/t/how-to-exclude-certain-files-from-circleci-test-globbing/41028)
TESTFILES=$(find src -regextype posix-extended -name '*.cy.*' -not -regex '.*(FileMatch|PromoAction|SelectorPlayground|useDurationFormat|useTestingType|SpecPatterns|DebugPendingRunCounts).cy.*' | circleci tests split --total=$CIRCLE_NODE_TOTAL)
TESTFILES=$(find src -regextype posix-extended -name '*.cy.*' -not -regex '.*(FileMatch|PromoAction|SelectorPlayground|useDurationFormat|useTestingType|SpecPatterns|DebugPendingRunCounts|DebugRunStates|DebugPageHeader|DebugPendingRunSplash|DebugRunNavigation|DebugRunNavigationLimitMessage).cy.*' | circleci tests split --total=$CIRCLE_NODE_TOTAL)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also ignoring some extra CT tests that fail on contributor PRs for some reason

@cypress
Copy link

cypress bot commented Sep 21, 2023

30 flaky tests on run #51227 ↗︎

0 28134 1345 0 Flakiness 30

Details:

add skip step to trigger job
Project: cypress Commit: 996f7502a7
Status: Passed Duration: 20:21 💡
Started: Sep 21, 2023 9:06 PM Ended: Sep 21, 2023 9:26 PM
Flakiness  settings.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
App: Settings > Project settings > highlights values set via config file, envFile, env, or CLI in the appropriate color with default specPattern Test Replay Output Screenshots
Flakiness  runner/reporter-ct-mount-hover.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
CT Mount create-react-app-configured > While hovering on Mount(), shows component on AUT for create-react-app-configured Test Replay Output Screenshots
Flakiness  specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs Test Replay Output Screenshots
Flakiness  scaffold-component-testing.cy.ts • 1 flaky test • launchpad-e2e

View Output Video

Test Artifacts
scaffolding component testing > react-vite-ts-unconfigured > scaffolds component testing for React and Vite Test Replay Output Screenshots
Flakiness  project-setup.cy.ts • 4 flaky tests • launchpad-e2e

View Output Video

Test Artifacts
... > skips the setup page when choosing e2e tests to run Test Replay Output Screenshots
... > can reconfigure config after CT has been set up Test Replay Output Screenshots
... > skips the setup steps when choosing component tests to run Test Replay Output Screenshots
Launchpad: Setup Project > switch testing types > takes the user to first step of e2e setup when switching from app Test Replay Output Screenshots

The first 5 flaky specs are shown, see all 15 specs in Cypress Cloud.

Review all test suite changes for PR #27876 ↗︎

@astone123 astone123 merged commit 273d8ce into develop Sep 21, 2023
5 of 6 checks passed
@astone123 astone123 deleted the astone123/skip-binary-build-contributor branch September 21, 2023 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants