Skip to content

Commit

Permalink
Merge branch 'develop' into issue-14978
Browse files Browse the repository at this point in the history
  • Loading branch information
panzarino committed Feb 15, 2021
2 parents a092ec8 + 484f1eb commit 90024e6
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 3 deletions.
17 changes: 14 additions & 3 deletions cli/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,25 @@ module.exports = {
.command('run-ct', { hidden: true })
.usage('[options]')
.description('Runs all Cypress Component Testing suites')
.option('-b, --browser <browser-path>', text('browserOpenMode'))
.option('-b, --browser <browser-name-or-path>', text('browserRunMode'))
.option('--ci-build-id <id>', text('ciBuildId'))
.option('-c, --config <config>', text('config'))
.option('-C, --config-file <config-file>', text('configFile'))
.option('-d, --detached [bool]', text('detached'), coerceFalse)
.option('-e, --env <env>', text('env'))
.option('--global', text('global'))
.option('--group <name>', text('group'))
.option('-k, --key <record-key>', text('key'))
.option('--headed', text('headed'))
.option('--headless', text('headless'))
.option('--no-exit', text('exit'))
.option('--parallel', text('parallel'))
.option('-p, --port <port>', text('port'))
.option('-P, --project <project-path>', text('project'))
.option('-q, --quiet', text('quiet'))
.option('--record [bool]', text('record'), coerceFalse)
.option('-r, --reporter <reporter>', text('reporter'))
.option('-o, --reporter-options <reporter-options>', text('reporterOptions'))
.option('-s, --spec <spec>', text('spec'))
.option('-t, --tag <tag>', text('tag'))
.option('--dev', text('dev'), coerceFalse)
.action((opts) => {
debug('running Cypress run-ct')
Expand Down
2 changes: 2 additions & 0 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5424,6 +5424,8 @@ declare namespace Cypress {
/** Override *name* for display purposes only */
displayName: string
message: any
/** Set to false if you want to control the finishing of the command in the log yourself */
autoEnd: boolean
/** Return an object that will be printed in the dev tools console */
consoleProps(): ObjectLike
}
Expand Down
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

0 comments on commit 90024e6

Please sign in to comment.