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

Add: webhook handling for gutenberg edge label #82

Merged
merged 2 commits into from
Dec 9, 2019
Merged
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
23 changes: 21 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const e2eCanaryTestsWrapperBranch = process.env.E2E_WRAPPER_BRANCH || 'master';
const calypsoCanaryTriggerLabel = process.env.CALYPSO_TRIGGER_LABEL || '[Status] Needs Review';
const calypsoFullSuiteTriggerLabel = process.env.CALYPSO_FULL_SUITE_TRIGGER_LABEL || '[Status] Needs e2e Testing';
const calypsoFullSuiteHorizonTriggerLabel = process.env.CALYPSO_FULL_SUITE_HORIZON_TRIGGER_LABEL || '[Status] Needs e2e Testing horizon';
const calypsoFullSuiteGutenbergLabel = process.env.CALYPSO_FULL_SUITE_GUTENBERG_TRIGGER_LABEL || '[Status] Needs e2e Testing Gutenberg Edge';
const calypsoFullSuiteJetpackTriggerLabel = process.env.CALYPSO_FULL_SUITE_JETPACK_TRIGGER_LABEL || '[Status] Needs Jetpack e2e Testing';
const calypsoFullSuiteSecureAuthTriggerLabel = process.env.CALYPSO_FULL_SUITE_SECURE_AUTH_TRIGGER_LABEL || '[Status] Needs Secure Auth e2e Testing';

Expand Down Expand Up @@ -259,8 +260,15 @@ handler.on( 'pull_request', function( event ) {
}

// Calypso test execution on label
if ( ( action === 'labeled' || action === 'synchronize' ) && repositoryName === calypsoProject && ( labelsArray.includes( calypsoCanaryTriggerLabel ) ||
labelsArray.includes( calypsoFullSuiteTriggerLabel ) || labelsArray.includes( calypsoFullSuiteJetpackTriggerLabel ) || labelsArray.includes( calypsoFullSuiteHorizonTriggerLabel ) ) ) {

if ( ( action === 'labeled' || action === 'synchronize' ) &&
repositoryName === calypsoProject && (
labelsArray.includes( calypsoCanaryTriggerLabel ) ||
labelsArray.includes( calypsoFullSuiteTriggerLabel ) ||
labelsArray.includes( calypsoFullSuiteJetpackTriggerLabel ) ||
labelsArray.includes( calypsoFullSuiteHorizonTriggerLabel ) ||
labelsArray.includes( calypsoFullSuiteGutenbergLabel )
) ) {
const branchName = event.payload.pull_request.head.ref;
const sha = event.payload.pull_request.head.sha;
const user = event.payload.pull_request.user.login;
Expand Down Expand Up @@ -310,6 +318,17 @@ handler.on( 'pull_request', function( event ) {
log.info( 'Executing CALYPSO e2e horizon full WPCOM suite mobile tests for branch: \'' + branchName + '\'' );
executeCircleCIBuild( 'false', '', '', e2eBranchName, pullRequestNum, 'ci/wp-e2e-tests-horizon-full-mobile', `-s mobile -g -u ${horizonBaseURL}`, description, sha, false, calypsoProject, null, envVars );
}

if ( labelsArray.includes( calypsoFullSuiteGutenbergLabel ) ) {
const envVars = { SKIP_DOMAIN_TESTS: true, GUTENBERG_EDGE: true };
description = 'The e2e full WPCOM suite desktop tests are running against your PR with the latest snapshot of Gutenberg';
log.info( 'Executing CALYPSO e2e full WPCOM suite desktop tests for with gutenberg edge branch: \'' + branchName + '\'' );
executeCircleCIBuild( 'false', '', '', e2eBranchName, pullRequestNum, 'ci/wp-e2e-tests-full-desktop-edge', '-s desktop -g', description, sha, false, calypsoProject, null, envVars );
Copy link
Contributor

Choose a reason for hiding this comment

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

@bsessions85 Is there a reason why we don't run tests against live branch for Gutenberg edge user? We had a situation where test was failing on a PR because it was looking for the selector which was introduced in that same PR Automattic/wp-calypso#38507 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

No, just an oversight. We were only running on horizon before, so didn't think about using live branches for it. It should be updated.


description = 'The e2e full WPCOM suite desktop tests are running against your PR with the latest snapshot of Gutenberg';
log.info( 'Executing CALYPSO e2e full WPCOM suite mobile tests with gutenberg edge for branch: \'' + branchName + '\'' );
executeCircleCIBuild( 'false', '', '', e2eBranchName, pullRequestNum, 'ci/wp-e2e-tests-full-mobile-edge', '-s mobile -g', description, sha, false, calypsoProject, null, envVars );
}
} );
} else if ( ( action === 'labeled' || action === 'synchronize' ) && repositoryName === jetpackProject && labelsArray.includes( jetpackCanaryTriggerLabel ) ) { // Jetpack test execution on label
const branchName = event.payload.pull_request.head.ref;
Expand Down