-
Notifications
You must be signed in to change notification settings - Fork 3.4k
chore: use cloud validations for packages/server api request/response types #32632
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
base: develop
Are you sure you want to change the base?
Changes from all commits
f61e780
b35c26e
f7a85d5
b4fe99b
f0e7345
753cee9
c9a4bcf
36318c2
b14d51f
681153e
331519c
a720aef
d7e2dd8
e108bab
5ff0444
ad06422
0ffa759
65256e4
cb8b59f
c537692
4485c3b
9b51fad
dfe3934
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| lib/validations |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -547,7 +547,7 @@ async function createInstance (options: InstanceOptions) { | |
| } | ||
| } | ||
|
|
||
| const _postInstanceTests = ({ | ||
| async function _postInstanceTests ({ | ||
| runId, | ||
| instanceId, | ||
| config, | ||
|
|
@@ -556,17 +556,18 @@ const _postInstanceTests = ({ | |
| parallel, | ||
| ciBuildId, | ||
| group, | ||
| }) => { | ||
| return api.postInstanceTests({ | ||
| runId, | ||
| instanceId, | ||
| config, | ||
| tests, | ||
| hooks, | ||
| }) | ||
| .catch((err: any) => { | ||
| throwCloudCannotProceed({ parallel, ciBuildId, group, err }) | ||
| }) | ||
| }) { | ||
| try { | ||
| return await api.postInstanceTests({ | ||
| runId, | ||
| instanceId, | ||
| config, | ||
| tests, | ||
| hooks, | ||
| }) | ||
| } catch (err: unknown) { | ||
| throw cloudCannotProceedErr({ parallel, ciBuildId, group, err }) | ||
| } | ||
| } | ||
|
|
||
| const createRunAndRecordSpecs = (options: any = {}) => { | ||
|
|
@@ -793,42 +794,34 @@ const createRunAndRecordSpecs = (options: any = {}) => { | |
| }) | ||
| .value() | ||
|
|
||
| const responseDidFail = {} | ||
| const response = await _postInstanceTests({ | ||
| runId, | ||
| instanceId, | ||
| config: resolvedRuntimeConfig, | ||
| tests, | ||
| hooks, | ||
| parallel, | ||
| ciBuildId, | ||
| group, | ||
| }) | ||
| .catch((err: any) => { | ||
| onError(err) | ||
|
|
||
| return responseDidFail | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we no longer need this logic? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's still there, just without the boolean flag. This "hanging" behavior is further down in the |
||
| }) | ||
|
|
||
| if (response === responseDidFail) { | ||
| debug('`responseDidFail` equals `response`, allowing browser to hang until it is killed: Response %o', { responseDidFail }) | ||
| try { | ||
| const response = await _postInstanceTests({ | ||
| runId, | ||
| instanceId, | ||
| config: resolvedRuntimeConfig, | ||
| tests, | ||
| hooks, | ||
| parallel, | ||
| ciBuildId, | ||
| group, | ||
| }) | ||
|
|
||
| // dont call the cb, let the browser hang until it's killed | ||
| return | ||
| } | ||
| if (_.some(response.actions, { type: 'SPEC', action: 'SKIP' })) { | ||
| errorsWarning('CLOUD_CANCEL_SKIPPED_SPEC') | ||
|
|
||
| if (_.some(response.actions, { type: 'SPEC', action: 'SKIP' })) { | ||
| errorsWarning('CLOUD_CANCEL_SKIPPED_SPEC') | ||
| // set a property on the response so the browser runner | ||
| // knows not to start executing tests | ||
| project.emit('end', { skippedSpec: true, stats: {} }) | ||
|
|
||
| // set a property on the response so the browser runner | ||
| // knows not to start executing tests | ||
| project.emit('end', { skippedSpec: true, stats: {} }) | ||
| // dont call the cb, let the browser hang until it's killed | ||
| return | ||
| } | ||
|
|
||
| // dont call the cb, let the browser hang until it's killed | ||
| return | ||
| return cb(response) | ||
| } catch (err: unknown) { | ||
| onError(err) | ||
| debug('postInstanceTests failed, allowing browser to hang until it is killed: Error %o', { err }) | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
cacieprins marked this conversation as resolved.
Show resolved
Hide resolved
cacieprins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| return cb(response) | ||
| }) | ||
|
|
||
| return runAllSpecs({ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the
return awaitthrow to thecatch, hence awaiting the promise?