Skip to content

Commit

Permalink
fixes for cloudValidations - run ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tgriesser committed Apr 11, 2023
1 parent f2720cb commit 5191a6e
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 11,487 deletions.
1 change: 1 addition & 0 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ commands:
command: |
source ./scripts/ensure-node.sh
yarn gulp buildProd
yarn gulp syncCloudValidations
- run:
name: Build packages
command: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,6 @@ tooling/v8-snapshot/cache/dev-win32
tooling/v8-snapshot/cache/prod-darwin
tooling/v8-snapshot/cache/prod-linux
tooling/v8-snapshot/cache/prod-win32

# Cloud API validations
system-tests/lib/validations
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,4 @@
"sharp": "0.29.3",
"vue-template-compiler": "2.6.12"
}
}
}
3 changes: 2 additions & 1 deletion scripts/gulp/gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { execSync } from 'child_process'
import { webpackReporter, webpackRunner } from './tasks/gulpWebpack'
import { e2eTestScaffold, e2eTestScaffoldWatch } from './tasks/gulpE2ETestScaffold'
import dedent from 'dedent'
import { syncCloudValidations } from './tasks/gulpSyncValidations'
import { ensureCloudValidations, syncCloudValidations } from './tasks/gulpSyncValidations'

if (process.env.CYPRESS_INTERNAL_VITE_DEV) {
process.env.CYPRESS_INTERNAL_VITE_APP_PORT ??= '3333'
Expand Down Expand Up @@ -266,6 +266,7 @@ gulp.task(makePackage)
* here for debugging, e.g. `yarn gulp syncRemoteGraphQL`
*------------------------------------------------------------------------**/

gulp.task(ensureCloudValidations)
gulp.task(syncCloudValidations)
gulp.task(syncRemoteGraphQL)
gulp.task(generateFrontendSchema)
Expand Down
17 changes: 16 additions & 1 deletion scripts/gulp/tasks/gulpSyncValidations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ import fs from 'fs-extra'
import path from 'path'
import crossFetch from 'cross-fetch'

const VALIDATION_BASE = process.env.CY_CLOUD_VALIDATION_BASE ?? 'http://localhost:1234'
const INTERNAL_CLOUD_ENV = process.env.CYPRESS_INTERNAL_ENV || 'production'

const CY_CLOUD_VALIDATION_BASE = {
test: 'https://api.cypress.io',
production: 'https://api.cypress.io',
staging: 'https://api-staging.cypress.io',
development: 'http://localhost:1234',
}

const VALIDATION_BASE = CY_CLOUD_VALIDATION_BASE[INTERNAL_CLOUD_ENV]

const OUTPUT_FOLDER = path.join(__dirname, '../../../system-tests/lib/validations')

Expand All @@ -23,3 +32,9 @@ export async function syncCloudValidations () {
fs.promises.writeFile(path.join(OUTPUT_FOLDER, 'cloudValidations.d.ts'), validationsTypes),
])
}

export async function ensureCloudValidations () {
if (!fs.existsSync(path.join(OUTPUT_FOLDER, 'cloudValidations.js')) || !fs.existsSync(path.join(OUTPUT_FOLDER, 'cloudValidations.d.ts'))) {
await syncCloudValidations()
}
}
2 changes: 1 addition & 1 deletion system-tests/__snapshots__/record_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2831,7 +2831,7 @@ exports['e2e record capture-protocol passing retrieves the capture protocol 1']
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png (800x2044)
- /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png (400x1022)
(Uploading Results)
Expand Down
2 changes: 1 addition & 1 deletion system-tests/lib/serverStub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const getSchemaErr = (tag, err, schema) => {
errors: err.errors,
object: err.object,
example: err.example,
message: `${tag} should follow ${schema} schema`,
message: `${tag} should follow ${schema.join('@')} schema`,
}
}

Expand Down
Loading

0 comments on commit 5191a6e

Please sign in to comment.