Skip to content

Commit

Permalink
chore: fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldis committed Sep 19, 2023
1 parent cf8bcb7 commit 709766c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
22 changes: 6 additions & 16 deletions packages/cypress-cloud/lib/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Debug from "debug";
import { ScreenshotArtifact, ScreenshotUploadInstruction } from "../types";
import { updateInstanceStdout } from "./api";
import { safe } from "./lang";
import { format } from "./log";
import { dim } from "./log";
import { ExecutionState } from "./state";
import { uploadImage, uploadJson, uploadVideo } from "./upload";
const debug = Debug("currents:artifacts");
Expand All @@ -24,8 +24,6 @@ export async function uploadArtifacts({
coverageFilePath,
coverageUploadUrl,
}: UploadArtifacts) {
// title("blue", "Uploading Results");

debug("uploading artifacts: %o", {
videoPath,
videoUploadUrl,
Expand All @@ -38,7 +36,6 @@ export async function uploadArtifacts({
const totalUploads =
(videoPath ? 1 : 0) + screenshots.length + (coverageUploadUrl ? 1 : 0);
if (totalUploads === 0) {
// info("Nothing to upload");
return;
}

Expand All @@ -49,7 +46,7 @@ export async function uploadArtifacts({
(e) => {
debug("failed uploading video %s. Error: %o", videoPath, e);
executionState.addWarning(
format("Failed uploading video %s. Error: %s", videoPath, e)
`Failed uploading video ${videoPath}.\n${dim(e)}`
);
},
() => debug("success uploading", videoPath)
Expand All @@ -69,7 +66,7 @@ export async function uploadArtifacts({
screenshotUploadUrls
);
executionState.addWarning(
format("No upload URL for screenshot: %s", screenshot.path)
`No upload URL for screenshot ${screenshot.path}`
);
return Promise.resolve();
}
Expand All @@ -82,11 +79,7 @@ export async function uploadArtifacts({
e
);
executionState.addWarning(
format(
"Failed uploading screenshot %s. Error: %s",
screenshot.path,
e
)
`Failed uploading screenshot ${screenshot.path}.\n${dim(e)}`
);
},
() => debug("success uploading", screenshot.path)
Expand All @@ -104,12 +97,9 @@ export async function uploadArtifacts({
coverageFilePath,
e
);

executionState.addWarning(
format(
"Failed uploading coverage file %s. Error: %s",
coverageFilePath,
e
)
`Failed uploading coverage file ${coverageFilePath}.\n${dim(e)}`
);
},

Expand Down
10 changes: 3 additions & 7 deletions packages/cypress-cloud/lib/results/captureHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Debug from "debug";
import { getCapturedOutput } from "../capture";
import { getCoverageFilePath } from "../coverage";
import { CypressTypes } from "../cypress.types";
import { dim, format } from "../log";
import { dim } from "../log";
import { createReportTaskSpec } from "../runner";
import { ConfigState, ExecutionState } from "../state";
import { SpecAfterResult } from "./specAfterResult";
Expand Down Expand Up @@ -91,13 +91,9 @@ export async function handleSpecAfter({
executionState.setSpecCoverage(spec.relative, path);
} else {
executionState.addWarning(
format(
`Error reading coverage file "%s". Coverage recording will be skipped.\n${dim(
`Error: %s`
)}`,
path,
`Error reading coverage file "${path}". Coverage recording will be skipped.\n${dim(
error
)
)}`
);
}
}
Expand Down

0 comments on commit 709766c

Please sign in to comment.