Skip to content

Commit b1f61fb

Browse files
authored
internal: (studio) remove CYPRESS_ENABLE_CLOUD_STUDIO_AI env (#32625)
1 parent bf03a20 commit b1f61fb

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

guides/studio-development.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ To run against locally developed Studio:
1111
- Set environment variables:
1212
- `CYPRESS_INTERNAL_ENV=<environment>` (typically `staging` or `production` to hit those deployments of `cypress-services`, or `development` if you want to hit a locally running version of `cypress-services`)
1313
- Set `CYPRESS_LOCAL_STUDIO_PATH` to a relative path pointing to the `cypress-services/app/packages/studio/dist/development` directory (regardless of the `CYPRESS_INTERNAL_ENV` set).
14-
- `CYPRESS_ENABLE_CLOUD_STUDIO_AI` to `true` if AI functionality is needed (note, the feature flag will also need to be set in the appropriate environment).
1514
- Clone the `cypress` repo
1615
- Run `yarn`
1716
- Run `yarn cypress:open`

packages/server/lib/cloud/studio/studio.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ export class StudioManager implements StudioManagerShape {
7272
}
7373

7474
async canAccessStudioAI (browser: Cypress.Browser): Promise<boolean> {
75-
const envEnabled = process.env.CYPRESS_ENABLE_CLOUD_STUDIO_AI === 'true'
76-
77-
return envEnabled && !!(await this.invokeAsync('canAccessStudioAI', { isEssential: true }, browser))
75+
return !!(await this.invokeAsync('canAccessStudioAI', { isEssential: true }, browser))
7876
}
7977

8078
async initializeStudioAI (options: StudioAIInitializeOptions): Promise<void> {

packages/server/test/unit/cloud/studio/studio_spec.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,29 +137,15 @@ describe('lib/cloud/studio', () => {
137137
process.env = originalEnv
138138
})
139139

140-
it('returns true when CYPRESS_ENABLE_CLOUD_STUDIO_AI is true and studio server can access AI', async () => {
141-
process.env.CYPRESS_ENABLE_CLOUD_STUDIO_AI = 'true'
142-
140+
it('returns true when studio server can access AI', async () => {
143141
sinon.stub(studio, 'canAccessStudioAI').resolves(true)
144142

145143
const result = await studioManager.canAccessStudioAI(browser)
146144

147145
expect(result).to.be.true
148146
})
149147

150-
it('returns false when CYPRESS_ENABLE_CLOUD_STUDIO_AI is false and studio server can access AI', async () => {
151-
process.env.CYPRESS_ENABLE_CLOUD_STUDIO_AI = 'false'
152-
153-
sinon.stub(studio, 'canAccessStudioAI').resolves(true)
154-
155-
const result = await studioManager.canAccessStudioAI(browser)
156-
157-
expect(result).to.be.false
158-
})
159-
160-
it('returns false when CYPRESS_ENABLE_CLOUD_STUDIO_AI is true and studio server cannot access AI', async () => {
161-
process.env.CYPRESS_ENABLE_CLOUD_STUDIO_AI = 'true'
162-
148+
it('returns false when studio server cannot access AI', async () => {
163149
sinon.stub(studio, 'canAccessStudioAI').resolves(false)
164150

165151
const result = await studioManager.canAccessStudioAI(browser)

0 commit comments

Comments
 (0)