Skip to content

Commit

Permalink
chore: working rename
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldis committed Oct 17, 2023
1 parent 176c7a1 commit fb97d57
Show file tree
Hide file tree
Showing 192 changed files with 570 additions and 3,816 deletions.
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 currents from "cc-est/plugin";
import { defineConfig } from "cypress";
import currents from "cypress-cloud-est/plugin";

module.exports = defineConfig({
video: true,
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,5 +1,5 @@
import registerCypressGrep from "@cypress/grep/src/support";
require("cypress-cloud/support");
require("cc-est/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.17.4",
"cypress-cloud": "*",
"cc-est": "*",
"cypress-terminal-report": "^5.3.3",
"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("cypress-cloud");
const { run } = require("cypress");

(async function runTests() {
const projectId = process.env.CURRENTS_PROJECT_ID || "projectId";
Expand Down
957 changes: 509 additions & 448 deletions package-lock.json

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CurrentsRunParameters, TestingType } from "cypress-cloud/types";
import { CurrentsRunParameters, TestingType } from "cc-est/types";
import Debug from "debug";
import { activateDebug } from "../../lib/debug";
import { sanitizeAndConvertNestedArgs } from "./parser";
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://github.com/currents-dev/cypress-cloud/issues/71
// https://github.com/currents-dev/cc-est/issues/71
// keep the local copy to prevent from importing
// commander.js from the global node_modules
import { getLegalNotice } from "../../legal";
Expand All @@ -7,7 +7,7 @@ import { Command, Option } from "./@commander-js/extra-typings";

export const createProgram = (command: Command = new Command()) =>
command
.name("cypress-cloud")
.name("cc-est")
.description(
`
Run Cypress tests on CI using https://currents.dev or https://sorry-cypress.dev as an orchestration and reporting service
Expand Down Expand Up @@ -106,14 +106,14 @@ ${getLegalNotice()}
)
.addOption(
new Option(
"--cloud-config-file <path>",
"Specify the config file for cypress-cloud, defaults to 'currents.config.js' and will be searched in the project root, unless an aboslue path is provided"
"--cc-config-file <path>",
"Specify the config file for cc-est, defaults to 'currents.config.js' and will be searched in the project root, unless an aboslue path is provided"
).default(undefined)
)
.addOption(
new Option(
`--cloud-debug [true | string]`,
`Enable debug mode for cypress-cloud, this will print out logs for troubleshooting. Values: [true | ${Object.values(
`Enable debug mode for cc-est, this will print out logs for troubleshooting. Values: [true | ${Object.values(
DebugMode
).join(
" | "
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Copyright (C) ${new Date().getFullYear()} Currents Software Inc https://currents
This is free software, and you are welcome to redistribute it under certain
conditions. This program comes with no warranty. Parts of this program are MIT
licensed. Refer to the license for details
https://github.com/currents-dev/cypress-cloud/blob/main/LICENSE.md
https://github.com/currents-dev/cc-est/blob/main/LICENSE.md
`;
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const results = {
testId: "r0",
testAttemptIndex: 0,
takenAt: expect.any(String),
path: "/Users/agoldis/cypress-cloud/examples/webapp/cypress/screenshots/failed.spec.js/Failed -- should fail (failed).png",
path: "/Users/agoldis/cc-est/examples/webapp/cypress/screenshots/failed.spec.js/Failed -- should fail (failed).png",
height: 1440,
width: 2560,
},
Expand All @@ -70,7 +70,7 @@ export const results = {
originalFile: "cypress/e2e/failed.spec.js",
relativeFile: "examples/webapp/cypress/e2e/failed.spec.js",
absoluteFile:
"/Users/agoldis/cypress-cloud/examples/webapp/cypress/e2e/failed.spec.js",
"/Users/agoldis/cc-est/examples/webapp/cypress/e2e/failed.spec.js",
frame:
' 1 | describe("Failed", function () {\n 2 | it("should fail", function () {\n> 3 | expect(fail).to.be.true;\n | ^\n 4 | });\n 5 | });\n 6 | ',
language: "js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const results = {
height: 1320,
width: 2000,
name: "custom-screenshot",
path: "/Users/agoldis/cypress-cloud/examples/webapp/cypress/screenshots/passed.spec.js/Passed -- should pass.png",
path: "/Users/agoldis/cc-est/examples/webapp/cypress/screenshots/passed.spec.js/Passed -- should pass.png",
takenAt: expect.any(String),
testAttemptIndex: 0,
testId: "r0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const results = {
height: 1440,
width: 2560,
name: null,
path: "/Users/agoldis/cypress-cloud/examples/webapp/cypress/screenshots/retries.spec.js/Retries -- Runs a test with retries (failed).png",
path: "/Users/agoldis/cc-est/examples/webapp/cypress/screenshots/retries.spec.js/Retries -- Runs a test with retries (failed).png",
takenAt: expect.any(String),
testAttemptIndex: 0,
testId: "r0",
Expand All @@ -55,7 +55,7 @@ export const results = {
height: 1440,
width: 2560,
name: null,
path: "/Users/agoldis/cypress-cloud/examples/webapp/cypress/screenshots/retries.spec.js/Retries -- Runs a test with retries (failed) (attempt 2).png",
path: "/Users/agoldis/cc-est/examples/webapp/cypress/screenshots/retries.spec.js/Retries -- Runs a test with retries (failed) (attempt 2).png",
takenAt: expect.any(String),
testAttemptIndex: 1,
testId: "r0",
Expand All @@ -80,7 +80,7 @@ export const results = {
originalFile: "cypress/e2e/retries.spec.js",
relativeFile: "examples/webapp/cypress/e2e/retries.spec.js",
absoluteFile:
"/Users/agoldis/cypress-cloud/examples/webapp/cypress/e2e/retries.spec.js",
"/Users/agoldis/cc-est/examples/webapp/cypress/e2e/retries.spec.js",
frame:
' 9 | if (i > 1) {\n 10 | i--;\n> 11 | throw new Error("oh no!");\n | ^\n 12 | }\n 13 | return;\n 14 | }',
language: "js",
Expand All @@ -102,7 +102,7 @@ export const results = {
originalFile: "cypress/e2e/retries.spec.js",
relativeFile: "examples/webapp/cypress/e2e/retries.spec.js",
absoluteFile:
"/Users/agoldis/cypress-cloud/examples/webapp/cypress/e2e/retries.spec.js",
"/Users/agoldis/cc-est/examples/webapp/cypress/e2e/retries.spec.js",
frame:
' 9 | if (i > 1) {\n 10 | i--;\n> 11 | throw new Error("oh no!");\n | ^\n 12 | }\n 13 | return;\n 14 | }',
language: "js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const results = {
height: 1440,
width: 2560,
name: null,
path: "/Users/agoldis/cypress-cloud/examples/webapp/cypress/screenshots/skipped.spec.js/Skipped -- should not be skipped -- before each hook (failed).png",
path: "/Users/agoldis/cc-est/examples/webapp/cypress/screenshots/skipped.spec.js/Skipped -- should not be skipped -- before each hook (failed).png",
takenAt: expect.any(String),
testAttemptIndex: 0,
testId: "r0",
Expand All @@ -78,7 +78,7 @@ export const results = {
originalFile: "cypress/e2e/skipped.spec.js",
relativeFile: "examples/webapp/cypress/e2e/skipped.spec.js",
absoluteFile:
"/Users/agoldis/cypress-cloud/examples/webapp/cypress/e2e/skipped.spec.js",
"/Users/agoldis/cc-est/examples/webapp/cypress/e2e/skipped.spec.js",
frame:
' 1 | describe("Skipped", function () {\n 2 | beforeEach(function () {\n> 3 | throw new Error("before each exception");\n | ^\n 4 | });\n 5 | it("should not be skipped", function () {\n 6 | expect(true).to.be.true;',
language: "js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createRun, CreateRunResponse } from "cypress-cloud/lib/api";
import { getAPIBaseUrl } from "cypress-cloud/lib/httpClient/config";
import { createRun, CreateRunResponse } from "cc-est/lib/api";
import { getAPIBaseUrl } from "cc-est/lib/httpClient/config";
import nock from "nock";
import { printWarnings } from "../warnings";
import { createRunPayload, createRunResponse } from "./fixtures/run";

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {
setInstanceTests,
updateInstanceResults,
updateInstanceStdout,
} from "cypress-cloud/lib/api";
import { getAPIBaseUrl } from "cypress-cloud/lib/httpClient/config";
} from "cc-est/lib/api";
import { getAPIBaseUrl } from "cc-est/lib/httpClient/config";
import _ from "lodash";
import nock from "nock";

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CreateRunPayload, CreateRunResponse } from "cypress-cloud/lib/api/";
import { CreateRunPayload, CreateRunResponse } from "cc-est/lib/api/";

export const createRunPayload: CreateRunPayload = {
ci: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Platform, ScreenshotArtifact } from "cypress-cloud/types";
import { Platform, ScreenshotArtifact } from "cc-est/types";
import { Standard } from "../../cypress.types";
import { TestAttemptState, TestState } from "../../cypress.types/shared";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Platform, ValidatedCurrentsParameters } from "cypress-cloud-est/types";
import { Platform, ValidatedCurrentsParameters } from "cc-est-est/types";
import { CiParams, CiProvider } from "../../ciProvider";

export type CreateRunPayload = {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ValidatedCurrentsParameters } from "cc-est/types";
import { getBinPath } from "cy2";
import { ValidatedCurrentsParameters } from "cypress-cloud/types";
import Debug from "debug";
import execa, { ExecaError } from "execa";
import fs from "fs";
Expand Down Expand Up @@ -31,7 +31,7 @@ export const bootCypress = async (params: ValidatedCurrentsParameters) => {
try {
const f = fs.readFileSync(tempFilePath, "utf-8");
if (!f) {
throw new Error("Is cypress-cloud/plugin installed?");
throw new Error("Is cc-est/plugin installed?");
}
debug("cypress config '%s': '%s'", tempFilePath, f);
return JSON.parse(f);
Expand All @@ -41,7 +41,7 @@ export const bootCypress = async (params: ValidatedCurrentsParameters) => {
info(bold("Cypress stderr:\n"), stderr);

throw new ValidationError(`Unable to resolve cypress configuration
- make sure that 'cypress-cloud/plugin' is installed
- make sure that 'cc-est/plugin' is installed
- report the issue together with cypress stdout and stderr
`);
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";
import { ValidationError } from "cypress-cloud/lib/errors";
import { CurrentsRunParameters } from "cypress-cloud/types";
import { ValidationError } from "cc-est/lib/errors";
import { CurrentsRunParameters } from "cc-est/types";
import { getCurrentsConfig } from "../config";
import {
cloudServiceInvalidUrlError,
Expand All @@ -10,7 +10,7 @@ import {
validateParams,
} from "../params";

jest.mock("cypress-cloud/lib/log");
jest.mock("cc-est/lib/log");
jest.mock("../config", () => ({
getCurrentsConfig: jest.fn(() => ({
e2e: {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
CurrentsRunParameters,
CypressRunParameters,
ValidatedCurrentsParameters,
} from "cypress-cloud/types";
} from "cc-est/types";
import Debug from "debug";
import _ from "lodash";
import { shouldEnablePluginDebug } from "../debug";
Expand All @@ -16,7 +16,7 @@ export async function resolveCurrentsParams(
): Promise<CurrentsRunParameters> {
const configFromFile = await getCurrentsConfig(
params.project,
params.cloudConfigFile
params.ccConfigFile
);

debug("resolving currents params: %o", params);
Expand Down Expand Up @@ -171,7 +171,7 @@ export function getCypressRunAPIParams(
..._.pickBy(
_.omit(params, [
"cloudDebug",
"cloudConfigFile",
"ccConfigFile",
"autoCancelAfterFailures",
"cloudServiceUrl",
"batchSize",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export namespace Cypress12 {
}

export interface Spec {
absolute: string; // /Users/agoldis/cypress-cloud/examples/webapp/cypress/e2e/crash.spec.js
absolute: string; // /Users/agoldis/cc-est/examples/webapp/cypress/e2e/crash.spec.js
baseName: string; // crash.spec.js
fileExtension: string; // .js
fileName: string; // crash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export namespace Cypress13 {
}

export interface Spec {
absolute: string; // /Users/agoldis/cypress-cloud/examples/webapp/cypress/e2e/crash.spec.js
absolute: string; // /Users/agoldis/cc-est/examples/webapp/cypress/e2e/crash.spec.js
fileExtension: string; // .js
fileName: string; // crash
name: string; // crash.spec.js
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from "@jest/globals";
import { ValidatedCurrentsParameters } from "cc-est/types";
import { run } from "cypress";
import { ValidatedCurrentsParameters } from "cypress-cloud/types";
import { runSpecFile } from "../cypress";
jest.mock("cypress", () => ({
run: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import cypress from "cypress";
import {
CurrentsRunParameters,
ValidatedCurrentsParameters,
} from "cypress-cloud/types";
} from "cc-est/types";
import cypress from "cypress";
import Debug from "debug";
import _ from "lodash";
import { getCypressRunAPIParams } from "../config";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from "@jest/globals";
import * as log from "cypress-cloud/lib/log";
import * as log from "cc-est/lib/log";
import nock from "nock";
import { makeRequest } from "../httpClient";
import { formatGenericError } from "../printErrors";

jest.mock("cypress-cloud/lib/log");
jest.mock("cc-est/lib/log");

const apiMock = nock("https://cy.currents.dev");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as log from "cypress-cloud/lib/log";
import * as log from "cc-est/lib/log";
import nock from "nock";
import { getAPIBaseUrl, getDelay, isRetriableError } from "../config";
import { makeRequest } from "../httpClient";

jest.mock("../config");
jest.mock("cypress-cloud/lib/log");
jest.mock("cc-est/lib/log");
(getAPIBaseUrl as jest.Mock).mockReturnValue("http://localhost:1234");
const apiMock = nock(getAPIBaseUrl()).persist();

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function getClient() {
"x-cypress-request-attempt": config["axios-retry"]?.retryCount ?? 0,
"x-cypress-version": _cypressVersion ?? "0.0.0",
"x-ccy-version": ccyVerson,
"User-Agent": `cypress-cloud/${ccyVerson}`,
"User-Agent": `cc-est/${ccyVerson}`,
};
if (_runId) {
headers["x-cypress-run-id"] = _runId;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "./stdout";
import "./ws";

const cypressPkg = require("cypress/package.json");
const pkg = require("cypress-cloud-est/package.json");
const pkg = require("cc-est/package.json");

import { initCapture } from "./capture";
import { setCurrentsVersion, setCypressVersion } from "./state/global";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class SpecAfterResult {
return match(attemptState)
.with("failed", () => ({
name: "Error",
message: "[cypress-cloud] Could not get cypress attempt error details",
message: "[cc-est] Could not get cypress attempt error details",
stack: "",
codeFrame: null,
}))
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function run(params: CurrentsRunParameters = {}) {
browser: validatedParams.browser,
});

info(`Cypress-cloud version: ${dim(_currentsVersion)}`);
info(`cc-est version: ${dim(_currentsVersion)}`);
info(`Cypress version: ${dim(_cypressVersion)}`);
info("Discovered %d spec files", specs.length);
info(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { describe, expect, it } from "@jest/globals";
import { warn } from "cypress-cloud/lib/log";
import { Event, getPubSub } from "cypress-cloud/lib/pubsub";
import { warn } from "cc-est/lib/log";
import { Event, getPubSub } from "cc-est/lib/pubsub";
import { random } from "lodash";
import { runTillDoneOrCancelled } from "../cancellable";
import { runTillDone } from "../runner";

jest.mock("../runner", () => ({
runTillDone: jest.fn().mockResolvedValue({}),
}));
jest.mock("cypress-cloud/lib/log", () => ({
jest.mock("cc-est/lib/log", () => ({
warn: jest.fn(),
}));

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit fb97d57

Please sign in to comment.