Skip to content

Commit a499c99

Browse files
authored
fix: CI Fixes related to #19308 (#19314)
* Fixing proxy_performance_spec
1 parent 9d975ec commit a499c99

File tree

9 files changed

+33
-11
lines changed

9 files changed

+33
-11
lines changed

packages/app/cypress/e2e/integration/settings.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ describe('Settings', { viewportWidth: 600 }, () => {
4040
})
4141

4242
it('selects well known editor', () => {
43-
cy.visitApp()
4443
cy.withCtx(async (ctx) => {
4544
ctx.coreData.localSettings.availableEditors = [
4645
...ctx.coreData.localSettings.availableEditors,
@@ -56,6 +55,8 @@ describe('Settings', { viewportWidth: 600 }, () => {
5655
ctx.coreData.localSettings.preferences.preferredEditorBinary = undefined
5756
})
5857

58+
cy.visitApp()
59+
5960
cy.get('[href="#/settings"]').click()
6061
cy.contains('Device Settings').click()
6162

packages/data-context/src/actions/ProjectActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class ProjectActions {
7777
await this.clearActiveProject()
7878

7979
// Set initial properties, so we can set the config object on the active project
80-
await this.setCurrentProjectProperties({
80+
this.setCurrentProjectProperties({
8181
projectRoot,
8282
title,
8383
ctPluginsInitialized: false,

packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ export async function e2ePluginSetup (projectRoot: string, on: Cypress.PluginEve
6060
let remoteGraphQLIntercept: RemoteGraphQLInterceptor | undefined
6161

6262
on('task', {
63-
beforeEach () {
63+
async beforeEach () {
64+
await ctx?.destroy()
6465
clearCtx()
6566
setCtx(makeDataContext({}))
67+
testState = {}
6668
remoteGraphQLIntercept = undefined
6769

6870
return null
@@ -80,15 +82,13 @@ export async function e2ePluginSetup (projectRoot: string, on: Cypress.PluginEve
8082
async withCtx (obj: WithCtxObj) {
8183
// Ensure we spin up a completely isolated server/state for each test
8284
if (obj.activeTestId !== currentTestId) {
83-
await ctx?.destroy()
84-
currentTestId = obj.activeTestId
85+
currentTestId = obj.activeTestId;
8586

86-
testState = {};
8787
({ serverPortPromise, ctx } = runInternalServer({
8888
projectRoot: null,
8989
}, {
9090
loadCachedProjects: false,
91-
}) as {ctx: DataContext, serverPortPromise: Promise<number> })
91+
}) as { ctx: DataContext, serverPortPromise: Promise<number> })
9292

9393
const fetchApi = ctx.util.fetch
9494

packages/frontend-shared/cypress/e2e/support/e2eProjectDirs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const e2eProjectDirs = [
7373
'todos',
7474
'ts-installed',
7575
'ts-proj',
76+
'ts-proj-compiler',
7677
'ts-proj-custom-names',
7778
'ts-proj-esmoduleinterop-true',
7879
'ts-proj-tsconfig-in-plugins',

packages/graphql/schemas/cloud.graphql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,15 @@ enum CloudRunStatus {
289289
A CloudUser represents an User stored in the Cypress Cloud
290290
"""
291291
type CloudUser implements Node {
292+
"""
293+
Url to manage cloud organizations for this user
294+
"""
295+
cloudOrganizationsUrl: String
296+
297+
"""
298+
Url to create a cloud organization for this user
299+
"""
300+
createCloudOrganizationUrl: String
292301
email: String
293302

294303
"""

packages/graphql/schemas/schema.graphql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ enum CloudRunStatus {
236236

237237
"""A CloudUser represents an User stored in the Cypress Cloud"""
238238
type CloudUser implements Node {
239+
"""Url to manage cloud organizations for this user"""
240+
cloudOrganizationsUrl: String
241+
242+
"""Url to create a cloud organization for this user"""
243+
createCloudOrganizationUrl: String
239244
email: String
240245

241246
"""The display name of the user, if we have one"""

packages/server/lib/server-e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class ServerE2E extends ServerBase<SocketE2E> {
4646
private _urlResolver: Bluebird<Record<string, any>> | null
4747

4848
constructor (ctx: DataContext) {
49-
super(getCtx())
49+
super(ctx ?? getCtx())
5050

5151
this._urlResolver = null
5252
}

packages/server/test/performance/proxy_performance_spec.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
require('../spec_helper')
2-
const { setCtx, makeDataContext } = require('../../lib/makeDataContext')
32

4-
setCtx(makeDataContext({}))
3+
const { makeDataContext, setCtx } = require('../../lib/makeDataContext')
4+
5+
const ctx = setCtx(makeDataContext({}))
56

67
const cp = require('child_process')
78
const fse = require('fs-extra')
@@ -354,7 +355,7 @@ describe('Proxy Performance', function () {
354355
// turn off morgan
355356
config.morgan = false
356357

357-
cyServer = new ServerE2E()
358+
cyServer = new ServerE2E(ctx)
358359

359360
return cyServer.open(config, {
360361
SocketCtor: SocketE2E,

packages/server/test/spec_helper.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ before(function () {
100100

101101
const { setCtx, getCtx, clearCtx, makeDataContext } = require('../lib/makeDataContext')
102102

103+
before(() => {
104+
clearCtx()
105+
setCtx(makeDataContext({}))
106+
})
107+
103108
beforeEach(function () {
104109
clearCtx()
105110
setCtx(makeDataContext({}))

0 commit comments

Comments
 (0)