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

Fix/cypress 12 compat tests #9

Open
wants to merge 2 commits into
base: fix/cypress-13
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@


# [2.0.0-beta.1](https://github.com/currents-dev/cypress-cloud/compare/v2.0.0-beta.0...v2.0.0-beta.1) (2023-09-22)


### Bug Fixes

* debugging fixes ([d502b12](https://github.com/currents-dev/cypress-cloud/commit/d502b121b4a5bb85921fa26b6b04a12274be3b19))
- debugging fixes ([d502b12](https://github.com/currents-dev/cypress-cloud/commit/d502b121b4a5bb85921fa26b6b04a12274be3b19))

# [2.0.0-beta.0](https://github.com/currents-dev/cypress-cloud/compare/v1.10.0-beta.1...v2.0.0-beta.0) (2023-09-19)

Expand Down Expand Up @@ -339,4 +336,4 @@
- implement generic http client with retries ([a9711bd](https://github.com/currents-dev/cypress-cloud/commit/a9711bde1fbb2cd37dbc8979593159d183bfa866))
- improve setup steps ([9bf16fe](https://github.com/currents-dev/cypress-cloud/commit/9bf16fe5f3773db4aa2f169515303ea6d0973da6))
- separate stdout per spec file ([a9d01c3](https://github.com/currents-dev/cypress-cloud/commit/a9d01c349cbfe140a568a452b0e7163e6d27f2db))
- setup github actions ([d439f56](https://github.com/currents-dev/cypress-cloud/commit/d439f5660698177087fcc2e7a61c64ea263816f6))
- setup github actions ([d439f56](https://github.com/currents-dev/cypress-cloud/commit/d439f5660698177087fcc2e7a61c64ea263816f6))
2 changes: 1 addition & 1 deletion e2e/cypress-compatibility/__tests__/run.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, jest } from "@jest/globals";
import { fetchRun, runCypressCloud } from "../../utils/utils";
import { fetchRun, runCypressCloud } from "../utils/utils";

import { data as apiReference } from "../data-references/ccy-1.9.4-cy-12-crapi";
import { all, config, specs } from "../data-references/ccy-1.9.4-cy-12-cycl";
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions packages/cypress-cloud/lib/cypress.types/12.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export namespace Cypress12 {
videoTimestamp: number;
wallClockDuration: number;
wallClockStartedAt: string;
startedAt: string;
}

export interface TestError {
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress-cloud/lib/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const getGitInfo = async (projectRoot: string) => {
const commitInfo = await git.commitInfo(projectRoot);
return getCommitDefaults({
branch: commitInfo.branch,
remoteOrigin: commitInfo.remote,
remoteOrigin: commitInfo.remote ?? "null",
authorEmail: commitInfo.email,
authorName: commitInfo.author,
message: commitInfo.message,
Expand Down
19 changes: 15 additions & 4 deletions packages/cypress-cloud/lib/results/specAfterResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { MochaError } from "../cypress.types/shared";
import { warn } from "../log";
import { getRandomString } from "../nano";
import { ExecutionState, ExecutionStateTestAttempt } from "../state";
import { _cypressVersion } from "../state/global";

export class SpecAfterResult {
/**
Expand Down Expand Up @@ -104,6 +105,7 @@ export class SpecAfterResult {
"wallClockDuration" in cypressAttempt
? cypressAttempt.wallClockDuration
: null;

return {
state: cypressAttempt.state,
error: error
Expand All @@ -112,17 +114,20 @@ export class SpecAfterResult {
timings: "timings" in cypressAttempt ? cypressAttempt.timings : null,
wallClockStartedAt:
"wallClockStartedAt" in cypressAttempt
? cypressAttempt.wallClockStartedAt
? cypressAttempt.wallClockStartedAt ?? new Date().toISOString()
: new Date().toISOString(),
startedAt:
"startedAt" in cypressAttempt
? cypressAttempt.startedAt ?? new Date().toISOString()
: new Date().toISOString(),

wallClockDuration: duration ? duration : 0,
failedFromHookId:
"failedFromHookId" in cypressAttempt
? cypressAttempt.failedFromHookId
: null,
videoTimestamp:
"videoTimestamp" in cypressAttempt
? cypressAttempt.videoTimestamp
? cypressAttempt.videoTimestamp ?? 0
: 0,
};
}
Expand All @@ -140,6 +145,7 @@ export class SpecAfterResult {
wallClockStartedAt:
mochaAttempt.wallClockStartedAt ?? new Date().toISOString(),
wallClockDuration: mochaAttempt.duration ?? -1,
startedAt: mochaAttempt.wallClockStartedAt,
failedFromHookId:
"failedFromHookId" in cypressAttempt
? cypressAttempt.failedFromHookId
Expand Down Expand Up @@ -195,7 +201,12 @@ export class SpecAfterResult {
spec: CypressTypes.EventPayload.SpecAfter.Spec
): Standard.SpecAfter.Spec {
return {
name: spec.name,
name:
parseFloat(_cypressVersion!) >= 13
? spec.name
: "baseName" in spec
? spec.baseName
: "",
relative: spec.relative,
absolute: spec.absolute,
fileExtension: spec.fileExtension,
Expand Down