mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-24 16:09:32 -06:00
chore: add testingType to postRunRequest (#15703)
* add testingType to postRunRequest
This commit is contained in:
@@ -261,6 +261,7 @@ module.exports = {
|
||||
'recordKey',
|
||||
'specPattern',
|
||||
'tags',
|
||||
'testingType',
|
||||
]),
|
||||
runnerCapabilities,
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ const createRun = Promise.method((options = {}) => {
|
||||
ciBuildId: null,
|
||||
})
|
||||
|
||||
let { projectId, recordKey, platform, git, specPattern, specs, parallel, ciBuildId, group, tags } = options
|
||||
let { projectId, recordKey, platform, git, specPattern, specs, parallel, ciBuildId, group, tags, testingType } = options
|
||||
|
||||
if (recordKey == null) {
|
||||
recordKey = env.get('CYPRESS_RECORD_KEY')
|
||||
@@ -319,6 +319,7 @@ const createRun = Promise.method((options = {}) => {
|
||||
projectId,
|
||||
recordKey,
|
||||
specPattern,
|
||||
testingType,
|
||||
ci: {
|
||||
params: ciProvider.ciParams(),
|
||||
provider: ciProvider.provider(),
|
||||
@@ -562,7 +563,7 @@ const _postInstanceTests = ({
|
||||
}
|
||||
|
||||
const createRunAndRecordSpecs = (options = {}) => {
|
||||
const { specPattern, specs, sys, browser, projectId, config, projectRoot, runAllSpecs, parallel, ciBuildId, group, project, onError } = options
|
||||
const { specPattern, specs, sys, browser, projectId, config, projectRoot, runAllSpecs, parallel, ciBuildId, group, project, onError, testingType } = options
|
||||
const recordKey = options.key
|
||||
|
||||
// we want to normalize this to an array to send to API
|
||||
@@ -585,6 +586,7 @@ const createRunAndRecordSpecs = (options = {}) => {
|
||||
return createRun({
|
||||
git,
|
||||
specs,
|
||||
testingType,
|
||||
group,
|
||||
tags,
|
||||
parallel,
|
||||
|
||||
@@ -1513,7 +1513,7 @@ module.exports = {
|
||||
|
||||
const socketId = random.id()
|
||||
|
||||
const { projectRoot, record, key, ciBuildId, parallel, group, browser: browserName, tag } = options
|
||||
const { projectRoot, record, key, ciBuildId, parallel, group, browser: browserName, tag, testingType } = options
|
||||
|
||||
// this needs to be a closure over `this.exitEarly` and not a reference
|
||||
// because `this.exitEarly` gets overwritten in `this.listenForProjectEnd`
|
||||
@@ -1630,6 +1630,7 @@ module.exports = {
|
||||
browser,
|
||||
parallel,
|
||||
ciBuildId,
|
||||
testingType,
|
||||
project,
|
||||
projectId,
|
||||
projectRoot,
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
"@babel/core": "7.9.0",
|
||||
"@babel/preset-env": "7.9.0",
|
||||
"@cypress/debugging-proxy": "2.0.1",
|
||||
"@cypress/json-schemas": "5.37.3",
|
||||
"@cypress/json-schemas": "5.38.0",
|
||||
"@cypress/sinon-chai": "2.9.1",
|
||||
"@ffprobe-installer/ffprobe": "1.1.0",
|
||||
"@packages/desktop-gui": "0.0.0-development",
|
||||
|
||||
@@ -100,6 +100,7 @@ describe('e2e record', () => {
|
||||
expect(postRun.body.projectId).to.eq('pid123')
|
||||
expect(postRun.body.recordKey).to.eq('f858a2bc-b469-4e48-be67-0876339ee7e1')
|
||||
expect(postRun.body.specPattern).to.eq('cypress/integration/record*')
|
||||
expect(postRun.body.testingType).to.eq('e2e')
|
||||
|
||||
const firstInstance = requests[1]
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ const routeHandlers = {
|
||||
postRun: {
|
||||
method: 'post',
|
||||
url: '/runs',
|
||||
req: 'postRunRequest@2.3.0',
|
||||
req: 'postRunRequest@2.4.0',
|
||||
resSchema: 'postRunResponse@2.2.0',
|
||||
res: (req, res) => {
|
||||
if (!req.body.specs) {
|
||||
|
||||
@@ -273,6 +273,7 @@ describe('lib/modes/record', () => {
|
||||
version: '59',
|
||||
}
|
||||
const tag = 'nightly,develop'
|
||||
const testingType = 'e2e'
|
||||
|
||||
return recordMode.createRunAndRecordSpecs({
|
||||
key,
|
||||
@@ -287,6 +288,7 @@ describe('lib/modes/record', () => {
|
||||
specPattern,
|
||||
runAllSpecs,
|
||||
tag,
|
||||
testingType,
|
||||
})
|
||||
.then(() => {
|
||||
expect(commitInfo.commitInfo).to.be.calledWith(projectRoot)
|
||||
@@ -297,6 +299,7 @@ describe('lib/modes/record', () => {
|
||||
projectId,
|
||||
ciBuildId,
|
||||
recordKey: key,
|
||||
testingType,
|
||||
specPattern: 'spec/pattern1,spec/pattern2',
|
||||
specs: ['path/to/spec/a', 'path/to/spec/b'],
|
||||
platform: {
|
||||
|
||||
@@ -2164,10 +2164,10 @@
|
||||
lodash.merge "^4.6.2"
|
||||
lodash.omit "^4.5.0"
|
||||
|
||||
"@cypress/json-schemas@5.37.3":
|
||||
version "5.37.3"
|
||||
resolved "https://registry.yarnpkg.com/@cypress/json-schemas/-/json-schemas-5.37.3.tgz#2aed2fadc9533cb8d812ab27df77ea40ccf17759"
|
||||
integrity sha512-vMhydN3Ysx+d/PnbOixPzlWdvaOeHmano61D2Cwshexo3F8L68xsXqF6zy3T6teNWHXTMtNZ6fQUpcy3r082XQ==
|
||||
"@cypress/json-schemas@5.38.0":
|
||||
version "5.38.0"
|
||||
resolved "https://registry.yarnpkg.com/@cypress/json-schemas/-/json-schemas-5.38.0.tgz#8aad0c140eea4b0bab43f3f9e3df53386040db8f"
|
||||
integrity sha512-VEyiQ48KrFXJXg7giK6+uTQXa6GPDlnQl1Ss9OYxzhl5feoiV6ioHUKZKvrO+Acu4S9vFlpl3Xvvwlz0azw6kA==
|
||||
dependencies:
|
||||
"@cypress/schema-tools" "4.7.7"
|
||||
lodash "^4.17.21"
|
||||
|
||||
Reference in New Issue
Block a user