Skip to content

Commit

Permalink
fix: grab bitbucket PR environment variables (#15082)
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Feb 14, 2021
1 parent ecbec9d commit 741c580
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/server/lib/util/ci_provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ const _providerCiParams = () => {
'BITBUCKET_BUILD_NUMBER',
'BITBUCKET_PARALLEL_STEP',
'BITBUCKET_STEP_RUN_NUMBER',
// the PR variables are only set on pull request builds
'BITBUCKET_PR_ID',
'BITBUCKET_PR_DESTINATION_BRANCH',
'BITBUCKET_PR_DESTINATION_COMMIT',
]),
buildkite: extract([
'BUILDKITE_REPO',
Expand Down
55 changes: 55 additions & 0 deletions packages/server/test/unit/ci_provider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,61 @@ describe('lib/util/ci_provider', () => {
})
})

it('bitbucket pull request', () => {
resetEnv = mockedEnv({
CI: '1',

// build information
BITBUCKET_BUILD_NUMBER: 'bitbucketBuildNumber',
BITBUCKET_REPO_OWNER: 'bitbucketRepoOwner',
BITBUCKET_REPO_SLUG: 'bitbucketRepoSlug',
BITBUCKET_PARALLEL_STEP: 'bitbucketParallelStep',
BITBUCKET_STEP_RUN_NUMBER: 'bitbucketStepRunNumber',

// git information
BITBUCKET_COMMIT: 'bitbucketCommit',
BITBUCKET_BRANCH: 'bitbucketBranch',

// pull request info
BITBUCKET_PR_ID: 'bitbucketPrId',
BITBUCKET_PR_DESTINATION_BRANCH: 'bitbucketPrDestinationBranch',
BITBUCKET_PR_DESTINATION_COMMIT: 'bitbucketPrDestinationCommit',
}, { clear: true })

expectsName('bitbucket')
expectsCiParams({
bitbucketBuildNumber: 'bitbucketBuildNumber',
bitbucketRepoOwner: 'bitbucketRepoOwner',
bitbucketRepoSlug: 'bitbucketRepoSlug',
bitbucketParallelStep: 'bitbucketParallelStep',
bitbucketStepRunNumber: 'bitbucketStepRunNumber',
bitbucketPrId: 'bitbucketPrId',
bitbucketPrDestinationBranch: 'bitbucketPrDestinationBranch',
bitbucketPrDestinationCommit: 'bitbucketPrDestinationCommit',
})

expectsCommitParams({
sha: 'bitbucketCommit',
branch: 'bitbucketBranch',
})

expectsCommitDefaults({
sha: null,
branch: 'gitFoundBranch',
}, {
sha: 'bitbucketCommit',
branch: 'gitFoundBranch',
})

return expectsCommitDefaults({
sha: undefined,
branch: '',
}, {
sha: 'bitbucketCommit',
branch: 'bitbucketBranch',
})
})

it('buildkite', () => {
resetEnv = mockedEnv({
BUILDKITE: 'true',
Expand Down

4 comments on commit 741c580

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 741c580 Feb 14, 2021

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/circle-develop-741c580adb9d7c8fda9ee411f01fa253c8ca2540/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 741c580 Feb 14, 2021

Choose a reason for hiding this comment

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

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/appveyor-develop-741c580adb9d7c8fda9ee411f01fa253c8ca2540/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 741c580 Feb 14, 2021

Choose a reason for hiding this comment

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

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/appveyor-develop-741c580adb9d7c8fda9ee411f01fa253c8ca2540/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 741c580 Feb 14, 2021

Choose a reason for hiding this comment

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

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/circle-develop-741c580adb9d7c8fda9ee411f01fa253c8ca2540/cypress.tgz

Please sign in to comment.