Skip to content

Commit

Permalink
style: renaming pkg (#1)
Browse files Browse the repository at this point in the history
* style: renaming pkg

* style: update lock file

* style: rename cli

* chore: bump version

* fix: test config

* fix: cloudPlugin shouldn't be async func

* ci: fix tests

* ci: update run cmd

* style: rename cli configs

* ci: update tests

* style: update lock
  • Loading branch information
wrn14897 authored Jun 21, 2023
1 parent 9b2e15e commit 43412c4
Show file tree
Hide file tree
Showing 51 changed files with 85 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
env:
CURRENTS_API_URL: http://localhost:1234
run: >
npx cypress-cloud run
npx cypress-parallel run
--record
--parallel
--key some-key
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-smoke-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ jobs:
- name: Link monorepo packages
run: npm install

- name: Run Cypress with cypress-cloud CJS
- name: Run Cypress with cypress-parallel CJS
working-directory: ./examples/webapp
env:
CURRENTS_RECORD_KEY: "any"
CURRENTS_API_URL: http://localhost:1234
run: |
npm run cypress:script
- name: Run Cypress with cypress-cloud TS
- name: Run Cypress with cypress-parallel TS
working-directory: ./examples/webapp
env:
CURRENTS_RECORD_KEY: "any"
CURRENTS_API_URL: http://localhost:1234
run: |
npm run cypress:script:ts
- name: Run Cypress with cypress-cloud ESM
- name: Run Cypress with cypress-parallel ESM
working-directory: ./examples/webapp
env:
CURRENTS_RECORD_KEY: "any"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-smoke-component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
- name: Run server for components tests
run: npm run start &

- name: Run Cypress with cypress-cloud
- name: Run Cypress with cypress-parallel
working-directory: ./examples/webapp
env:
CURRENTS_API_URL: http://localhost:1234
run: >
npx cypress-cloud run
npx cypress-parallel run
--record
--parallel
--component
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-smoke-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
- name: Link monorepo packages
run: npm install

- name: Run Cypress with cypress-cloud
- name: Run Cypress with cypress-parallel
working-directory: ./examples/webapp
env:
CURRENTS_API_URL: http://localhost:1234
run: >
npx cypress-cloud run
npx cypress-parallel run
--record
--parallel
--key some-key
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Run in Offline mode
working-directory: ./examples/webapp
run: >
npx cypress-cloud run
npx cypress-parallel run
--record false
--browser chrome
--tag smoke,linux
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-smoke-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
- name: Run Cypress with cypress-cloud
working-directory: ./examples/webapp
run: |
npx cypress-cloud run --parallel --record --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id "smoke-windows-${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}" --spec "cypress/e2e_smoke/*.spec.js" --tag smoke,windows
npx cypress-parallel run --parallel --record --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id "smoke-windows-${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}" --spec "cypress/e2e_smoke/*.spec.js" --tag smoke,windows
2 changes: 1 addition & 1 deletion e2e/exports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test:plugin:mjs": "node ./plugin.mjs"
},
"dependencies": {
"@deploysentinel/cypress-cloud": "*"
"@deploysentinel/cypress-parallel": "*"
},
"devDependencies": {
"@types/node": "^17.0.12",
Expand Down
2 changes: 1 addition & 1 deletion e2e/exports/plugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const assert = require("assert");
const cloudPluginExport = require("@deploysentinel/cypress-cloud/plugin");
const cloudPluginExport = require("@deploysentinel/cypress-parallel/plugin");

assert(typeof cloudPluginExport.default === "function");
assert(typeof cloudPluginExport.cloudPlugin === "function");
2 changes: 1 addition & 1 deletion e2e/exports/plugin.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import cloudPluginDefault, { cloudPlugin } from "@deploysentinel/cypress-cloud/plugin";
import cloudPluginDefault, { cloudPlugin } from "@deploysentinel/cypress-parallel/plugin";

assert(typeof cloudPluginDefault === "function");
assert(typeof cloudPlugin === "function");
Expand Down
2 changes: 1 addition & 1 deletion e2e/exports/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import cloudPluginDefault, { cloudPlugin } from "@deploysentinel/cypress-cloud/plugin";
import cloudPluginDefault, { cloudPlugin } from "@deploysentinel/cypress-parallel/plugin";

assert(typeof cloudPluginDefault === "function");
assert(typeof cloudPlugin === "function");
Expand Down
2 changes: 1 addition & 1 deletion e2e/exports/run.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const assert = require("assert");
const { run } = require("@deploysentinel/cypress-cloud");
const { run } = require("@deploysentinel/cypress-parallel");
assert(typeof run === "function");
2 changes: 1 addition & 1 deletion e2e/exports/run.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "assert";
import { run } from "@deploysentinel/cypress-cloud";
import { run } from "@deploysentinel/cypress-parallel";

assert(typeof run === "function");
2 changes: 1 addition & 1 deletion e2e/exports/run.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "assert";
import { run } from "cypress-cloud";
import { run } from "@deploysentinel/cypress-parallel";

assert(typeof run === "function");
2 changes: 1 addition & 1 deletion e2e/monorepo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@deploysentinel/cypress-cloud": "*"
"@deploysentinel/cypress-parallel": "*"
},
"devDependencies": {
"@types/node": "^17.0.12",
Expand Down
2 changes: 1 addition & 1 deletion e2e/monorepo/packages/some/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "cypress";
import currents from "@deploysentinel/cypress-cloud/plugin";
import currents from "@deploysentinel/cypress-parallel/plugin";

module.exports = defineConfig({
e2e: {
Expand Down
2 changes: 1 addition & 1 deletion e2e/monorepo/packages/some/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import registerCypressGrep from "@cypress/grep/src/support";
require("cypress-terminal-report/src/installLogsCollector")();
require("@deploysentinel/cypress-cloud/support");
require("@deploysentinel/cypress-parallel/support");
require("./commands");

registerCypressGrep();
Expand Down
4 changes: 2 additions & 2 deletions examples/webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ Use the following commands to run cypress tests

```sh
npm install
npx cypress-cloud --parallel --record --key your_key --ci-build-id hello-cypress-cloud
npx cypress-parallel --parallel --record --key your_key --ci-build-id hello-cypress-cloud
```

### Component tests

```sh
npm install
npm run build && npm run start
npx cypress-cloud --parallel --record --key your_key --component --ci-build-id hello-cypress-cloud
npx cypress-parallel --parallel --record --key your_key --component --ci-build-id hello-cypress-cloud
```

## API Usage
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "cypress";
import currents from "@deploysentinel/cypress-cloud/plugin";
import currents from "@deploysentinel/cypress-parallel/plugin";

module.exports = defineConfig({
e2e: {
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import registerCypressGrep from "@cypress/grep/src/support";
require("cypress-terminal-report/src/installLogsCollector")();
require("@deploysentinel/cypress-cloud/support");
require("@deploysentinel/cypress-parallel/support");
require("./commands");

registerCypressGrep();
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"cypress": "^12.6.0",
"@deploysentinel/cypress-cloud": "*",
"@deploysentinel/cypress-parallel": "*",
"cypress-terminal-report": "^5.0.0",
"next": "^13.2.1",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/scripts/currents-script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const assert = require("assert");
const { run } = require("@deploysentinel/cypress-cloud");
const { run } = require("@deploysentinel/cypress-parallel");

(async function runTests() {
const projectId = process.env.CURRENTS_PROJECT_ID || "projectId";
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/scripts/currents-script.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import { run } from "@deploysentinel/cypress-cloud";
import { run } from "@deploysentinel/cypress-parallel";

(async function runTests() {
const projectId = process.env.CURRENTS_PROJECT_ID || "projectId";
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/scripts/currents-script.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import { run } from "@deploysentinel/cypress-cloud";
import { run } from "@deploysentinel/cypress-parallel";

(async function runTests() {
const projectId = process.env.CURRENTS_PROJECT_ID || "projectId";
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/scripts/run-from-github-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export GITHUB_REPOSITORY=
export CURRENTS_PROJECT_ID=
export CURRENTS_RECORD_KEY=

npx cypress-cloud --parallel --record --key ${CURRENTS_RECORD_KEY} --ci-build-id $(date +%s)
npx cypress-parallel --parallel --record --key ${CURRENTS_RECORD_KEY} --ci-build-id $(date +%s)
2 changes: 1 addition & 1 deletion examples/webapp/scripts/run-from-jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export JENKINS_VERSION=1
export BUILD_NUMBER=123
export CURRENTS_PROJECT_ID=
export CURRENTS_RECORD_KEY=
npx cypress-cloud --parallel --record --key ${CURRENTS_RECORD_KEY}
npx cypress-parallel --parallel --record --key ${CURRENTS_RECORD_KEY}
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/cypress-cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
## Setup
Install the package:
```bash
npm install --save-dev @deploysentinel/cypress-cloud
npm install --save-dev @deploysentinel/cypress-parallel
```

Add `@deploysentinel/cypress-cloud/plugin` to `cypress.config.{js|ts|mjs}`
Add `@deploysentinel/cypress-parallel/plugin` to `cypress.config.{js|ts|mjs}`
```js
// cypress.config.js
const { defineConfig } = require("cypress");
const { cloudPlugin } = require("@deploysentinel/cypress-cloud/plugin");
const { cloudPlugin } = require("@deploysentinel/cypress-parallel/plugin");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
Expand All @@ -24,5 +24,5 @@ module.exports = defineConfig({

## Usage
```
CYPRESS_DEPLOYSENTINEL_KEY=YOUR_API_KEY CYPRESS_PROJECT_ID=000000 npx cypress-cloud --parallel --record --ci-build-id JUST_TESTING_LOCALLY
CYPRESS_DEPLOYSENTINEL_KEY=YOUR_API_KEY CYPRESS_PROJECT_ID=000000 npx cypress-parallel --parallel --record --ci-build-id JUST_TESTING_LOCALLY
```
2 changes: 1 addition & 1 deletion packages/cypress-cloud/bin/lib/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CurrentsRunParameters, TestingType } from "@deploysentinel/cypress-cloud/types";
import { CurrentsRunParameters, TestingType } from "@deploysentinel/cypress-parallel/types";
import Debug from "debug";
import { sanitizeAndConvertNestedArgs } from "./parser";
import { program } from "./program";
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress-cloud/bin/lib/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Command, Option } from "./@commander-js/extra-typings";

export const createProgram = (command: Command = new Command()) =>
command
.name("cypress-cloud")
.name("cypress-parallel")
.description(
"Runs Cypress tests on CI using Currents as an orchestration and reporting service"
)
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress-cloud/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
"^.+\\.tsx?$": "@swc/jest",
},
moduleNameMapper: {
"cypress-cloud/(.*)$": "<rootDir>/../cypress-cloud/$1",
"@deploysentinel/cypress-parallel/(.*)$": "<rootDir>/../cypress-cloud/$1",
},
transformIgnorePatterns: ["node_modules"],
moduleFileExtensions: ["ts", "js", "d.ts"],
Expand Down
6 changes: 3 additions & 3 deletions packages/cypress-cloud/lib/api/__tests__/api.run.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createRun, CreateRunResponse } from "@deploysentinel/cypress-cloud/lib/api";
import { getAPIBaseUrl } from "@deploysentinel/cypress-cloud/lib/httpClient/config";
import { createRun, CreateRunResponse } from "@deploysentinel/cypress-parallel/lib/api";
import { getAPIBaseUrl } from "@deploysentinel/cypress-parallel/lib/httpClient/config";
import nock from "nock";
import { printWarnings } from "../warnings";
import { createRunPayload, createRunResponse } from "./fixtures/run";

jest.mock("../warnings");
jest.mock("@deploysentinel/cypress-cloud/lib/httpClient/config", () => ({
jest.mock("@deploysentinel/cypress-parallel/lib/httpClient/config", () => ({
getAPIBaseUrl: jest.fn().mockReturnValue("http://localhost:1234"),
}));

Expand Down
6 changes: 3 additions & 3 deletions packages/cypress-cloud/lib/api/__tests__/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import {
UpdateInstanceResultsPayload,
UpdateInstanceResultsResponse,
updateInstanceStdout,
} from "@deploysentinel/cypress-cloud/lib/api";
import { getAPIBaseUrl } from "@deploysentinel/cypress-cloud/lib/httpClient/config";
} from "@deploysentinel/cypress-parallel/lib/api";
import { getAPIBaseUrl } from "@deploysentinel/cypress-parallel/lib/httpClient/config";
import _ from "lodash";
import nock from "nock";

jest.mock("@deploysentinel/cypress-cloud/lib/httpClient/config", () => ({
jest.mock("@deploysentinel/cypress-parallel/lib/httpClient/config", () => ({
getAPIBaseUrl: jest.fn().mockReturnValue("http://localhost:1234"),
}));

Expand Down
Loading

0 comments on commit 43412c4

Please sign in to comment.