Skip to content
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

chore: bump to v190 #2

Open
wants to merge 46 commits into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e521048
feat: use ws to send spec results asap
agoldis May 30, 2023
685fc28
chore: rename cancellation
agoldis May 30, 2023
904b3e4
chore: use execution state
agoldis May 30, 2023
4a3da39
feat: report specs early via spec:before
agoldis Jun 1, 2023
1455637
chore: remove unused code
agoldis Jun 1, 2023
eac06a4
fix: report results for cypress crashes
agoldis Jun 1, 2023
4162bb2
chore: store config in executionState
agoldis Jun 1, 2023
feef33b
chore: add @types/ws
agoldis Jun 1, 2023
ab891a9
chore: fix tests
agoldis Jun 1, 2023
cab6abe
chore: prevent timeouts and double-reporting
agoldis Jun 1, 2023
8768dc2
chore: terminate http on shutdown
agoldis Jun 1, 2023
3fe9cef
chore: add debug messages
agoldis Jun 1, 2023
cc0019f
chore: use ESM friendly imports for ws
agoldis Jun 1, 2023
f783b8a
chore: release v1.8.0-beta.0
agoldis Jun 1, 2023
a289767
chore: use lil-http-terminator
agoldis Jun 2, 2023
39f2f20
chore: release v1.8.0-beta.1
agoldis Jun 2, 2023
f281119
chore: handle exceptions and edge cases
agoldis Jun 2, 2023
bc6f3e9
chore: mute tests
agoldis Jun 4, 2023
24b563f
chore: release v1.8.0-beta.2
agoldis Jun 5, 2023
2e8c6e2
fix: support --headed mode
agoldis Jun 12, 2023
ae23d0d
Merge branch 'feat/support-headed' into feat/faster-reporting
agoldis Jun 12, 2023
1a504f2
chore: release v1.8.0-beta.3
agoldis Jun 12, 2023
1d17d13
fix: support ESM packages (#144)
agoldis Jun 13, 2023
4c109b5
Merge branch 'feat/faster-reporting' of https://github.com/currents-d…
agoldis Jun 13, 2023
8619dcb
chore: release v1.8.0-beta.5
agoldis Jun 13, 2023
474471b
fix: merge default and fs config
agoldis Jun 21, 2023
4c11896
chore: [email protected]
agoldis Jun 21, 2023
4bb0bcf
chore: temp enable windows ci
agoldis Jun 21, 2023
9253db0
chore: test esm on windows
agoldis Jun 21, 2023
709d477
chore: use urls to load config files
agoldis Jun 21, 2023
92fc0d6
chore: restore example [skip ci]
agoldis Jun 21, 2023
6d4a49b
chore: release v1.8.0-beta.6
agoldis Jun 21, 2023
3fec3e2
Merge pull request #137 from currents-dev/feat/faster-reporting
agoldis Jun 27, 2023
e301df5
feat: add --cloud-config-file
agoldis Jun 27, 2023
83d2403
Merge pull request #149 from currents-dev/feat/custom-config-file
agoldis Jun 27, 2023
897238b
chore: release v1.8.0
agoldis Jun 27, 2023
b021296
fix: specify content-disposition header
agoldis Jun 27, 2023
1b61dad
chore: release v1.8.1
agoldis Jun 27, 2023
12ba9f4
fix: support custom network headers
agoldis Jun 29, 2023
5ab765e
Merge pull request #151 from currents-dev/feat/custom-user-agent
agoldis Jun 29, 2023
dfa4909
chore: release v1.8.2
agoldis Jun 29, 2023
68bef22
feat: enable debug mode
agoldis Jul 3, 2023
c33e356
chore: release v1.9.0-beta.0
agoldis Jul 3, 2023
fcad58f
Merge pull request #155 from currents-dev/feat/debug-mode
agoldis Jul 4, 2023
5225d56
chore: release v1.9.0
agoldis Jul 4, 2023
9d43563
Merge branch 'main' into warren/bump-to-v190
wrn14897 Jul 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 48 additions & 10 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Install the package:
npm install cypress-cloud
```

- Create a new configuration file: `currents.config.js` in the Cypress project’s root
- Create a new configuration file: `currents.config.js|mjs|cjs` in the Cypress project’s root. Use `--cloud-config-file` to explicitly provide the configuration file. Using ESM project? See the guide below.
- Set the `projectId` and the record key obtained from [Currents](https://app.currents.dev) or your self-hosted instance of Sorry Cypress:

```js
Expand Down Expand Up @@ -79,6 +79,11 @@ module.exports = {
projectId: "Ij0RfK", // Project Id obtained from https://app.currents.dev or Sorry Cypress
recordKey: "XXXXXXX", // Record key obtained from https://app.currents.dev, any value for Sorry Cypress
cloudServiceUrl: "https://cy.currents.dev", // Sorry Cypress users - the director service URL
// Additional headers for network requests, undefined by default
networkHeaders: {
"User-Agent": "Custom",
"x-ms-blob-type": "BlockBlob"
}
e2e: {
batchSize: 3, // orchestration batch size for e2e tests (Currents only, read below)
},
Expand All @@ -88,9 +93,25 @@ module.exports = {
};
```

`cypress-cloud` will search for `currents.config.js` at the project's root location (defined with `-P --project` CLI option).
### Configuration File Discovery

Override the default configuration values via environment variables:
`cypress-cloud` will search for a configuration file as follows:

- if `--cloud-config-file <string>` is defined, use its value

- use it as-is for absolute paths
- if it's a relative path, use the project's root location (defined with `-P --project` CLI option) as the base directory

- otherwise, use the default filenames in the project's root location (defined with `-P --project` CLI option) in the following order:
- `currents.config.js`
- `currents.config.cjs`
- `currents.config.mjs`

The configuration file will be read using [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) expression. Please make sure to use the correct syntax if you're using ESM modules (see the guide below).

### Configuration Overrides

You can override the configuration values via environment variables:

- `CURRENTS_API_URL` - sorry-cypress users - set the URL of your director service
- `CURRENTS_PROJECT_ID` - set the `projectId`
Expand All @@ -100,7 +121,7 @@ The configuration variables will resolve as follows:

- the corresponding CLI flag or `run` function parameter, otherwise
- environment variable if exist, otherwise
- `currents.config.js` value, otherwise
- configuration file `currents.config.js|cjs|mjs` value, otherwise
- the default value, otherwise throw

## Batched Orchestration
Expand Down Expand Up @@ -179,15 +200,34 @@ As an alternative, you can activate the `cloudPlugin` first, and then implement

Enable the debug mode to troubleshoot files discovery: `DEBUG=currents:specs npx cypress-cloud ...`

### Usage with ESM project

For ESM projects (`"type": "module"` in `package.json`) you can use one of the following formats:

- `currents.config.cjs` - CommonJS formatted file
- `currents.config.js` - ESM formatted file (i.e. no `require` statements)
- `currents.config.mjs` - ESM formatted file (i.e. no `require` statements)

Also, make sure that your `cypress.config.js|mjs|cjs|ts` is formatted accordingly. See examples in [`./e2e`](./e2e) directory.

## Troubleshooting

Enable the debug mode and run the command:
Enable the debug mode by adding `--cloud-debug true | all | cypress | currents | commit-info` flag

- `true | all` enable debug mode for all the tools
- `cypress` activate debug mode for cypress only
- `currents` activate the debug mode for currents only
- `commit-info` activate the debug mode for git commit info only

```sh
DEBUG=currents:* npx cypress-cloud run ...
# show all the debug information
npx cypress-cloud run ... --cloud-debug

# show only currents related debug information
npx cypress-cloud run ... --cloud-debug currents,commit-info
```

Capture all the logs in a plain text file and submit an issue.
Capture all the logs as a plain text file and share it with the support team for further troubleshooting.

## Testing

Expand Down Expand Up @@ -230,8 +270,6 @@ Using:
npm install cypress-cloud --registry http://localhost:4873
```



## Disclaimer

This software is not affilicated with Cypress.io Inc. All third party trademarks and materials (including logos, icons and labels) referenced herein are the property of their respective owners. The third party products or services that this software connects to are subject to their respective owners, please refer to their intellectual property and terms of service agreements.
This software is not affiliated with Cypress.io Inc. All third-party trademarks and materials (including logos, icons and labels) referenced herein are the property of their respective owners. The third-party products or services that this software connects to are subject to their respective owners, please refer to their intellectual property and terms of service agreements.
50 changes: 50 additions & 0 deletions .github/workflows/e2e-config-esm-cjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: e2e-config-esm-cjs

on:
push:

jobs:
e2e-config-esm-cjs:
if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
env:
DEBUG: currents:*

services:
director:
image: agoldis/sorry-cypress-director
ports:
- 1234:1234

strategy:
matrix:
node-version: ["18"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Link monorepo packages
run: npm install

- name: config-esm-cjs
working-directory: ./e2e/config-esm-cjs
env:
CURRENTS_API_URL: http://localhost:1234
run: >
npx cypress-cloud run
--record
--parallel
--key some-key
--browser chrome
--tag smoke,linux
--spec "./cypress/e2e/*.spec.js"
--ci-build-id "${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}"
50 changes: 50 additions & 0 deletions .github/workflows/e2e-config-esm-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: e2e-config-esm-js

on:
push:

jobs:
e2e-config-esm-js:
if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
env:
DEBUG: currents:*

services:
director:
image: agoldis/sorry-cypress-director
ports:
- 1234:1234

strategy:
matrix:
node-version: ["18"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Link monorepo packages
run: npm install

- name: config-esm-js
working-directory: ./e2e/config-esm-js
env:
CURRENTS_API_URL: http://localhost:1234
run: >
npx cypress-cloud run
--record
--parallel
--key some-key
--browser chrome
--tag smoke,linux
--spec "./cypress/e2e/*.spec.js"
--ci-build-id "${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}"
50 changes: 50 additions & 0 deletions .github/workflows/e2e-config-esm-mjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: e2e-config-esm-mjs

on:
push:

jobs:
e2e-config-esm-mjs:
if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
env:
DEBUG: currents:*

services:
director:
image: agoldis/sorry-cypress-director
ports:
- 1234:1234

strategy:
matrix:
node-version: ["18"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Link monorepo packages
run: npm install

- name: config-esm-mjs
working-directory: ./e2e/config-esm-mjs
env:
CURRENTS_API_URL: http://localhost:1234
run: >
npx cypress-cloud run
--record
--parallel
--key some-key
--browser chrome
--tag smoke,linux
--spec "./cypress/e2e/*.spec.js"
--ci-build-id "${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}"
50 changes: 50 additions & 0 deletions .github/workflows/e2e-config-noesm-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: e2e-config-noesm-js

on:
push:

jobs:
e2e-config-noesm-js:
if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
env:
DEBUG: currents:*

services:
director:
image: agoldis/sorry-cypress-director
ports:
- 1234:1234

strategy:
matrix:
node-version: ["18"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Link monorepo packages
run: npm install

- name: config-noesm-js
working-directory: ./e2e/config-noesm-js
env:
CURRENTS_API_URL: http://localhost:1234
run: >
npx cypress-cloud run
--record
--parallel
--key some-key
--browser chrome
--tag smoke,linux
--spec "./cypress/e2e/*.spec.js"
--ci-build-id "${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}"
14 changes: 13 additions & 1 deletion .github/workflows/e2e-smoke-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: e2e-smoke-windows

on:
push:
branches: [main]
# branches: [main]

jobs:
build:
Expand All @@ -27,6 +27,18 @@ jobs:
- name: Link monorepo packages
run: npm install

- name: Test ESM imports
working-directory: ./e2e/config-esm-js
run: >
npx cypress-cloud run
--record
--parallel
--key ${{ secrets.CURRENTS_RECORD_KEY }}
--browser chrome
--tag smoke,linux
--spec "./cypress/e2e/*.spec.js"
--ci-build-id "config-esm-js-${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}"

- name: Run Cypress with cypress-cloud
working-directory: ./examples/webapp
run: |
Expand Down
Loading