Skip to content

Commit

Permalink
fix: use video/mp4 for video uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldis committed Mar 21, 2023
1 parent 8be81df commit 90a8569
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/cypress-cloud/lib/env.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { getAPIBaseUrl } from "./httpClient/config";

export const isCurrents = () => getAPIBaseUrl() === "https://cy.currents.dev";
export const isCurrents = () =>
!!process.env.CURRENTS_ENFORCE_IS_CURRENTS ||
getAPIBaseUrl() === "https://cy.currents.dev";
2 changes: 1 addition & 1 deletion packages/cypress-cloud/lib/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function runBatch({
totalInstances: 0,
};

if (isCurrents() || !!process.env.CURRENTS_BATCHED_ORCHESTRATION) {
if (isCurrents()) {
debug("Getting batched tasks: %d", params.batchSize);
batch = await createBatchedInstances({
...runMeta,
Expand Down
4 changes: 2 additions & 2 deletions packages/cypress-cloud/lib/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const readFile = fs.promises.readFile;
const debug = Debug("currents:upload");

export function uploadVideo(file: string, url: string) {
return uploadFile(file, url, "application/octet-stream");
return uploadFile(file, url, "video/mp4");
}

export function uploadImage(file: string, url: string) {
return uploadFile(file, url, "image/png");
}

type UploadTypes = "application/octet-stream" | "image/png" | "plain/text";
type UploadTypes = "video/mp4" | "image/png" | "plain/text";
async function uploadFile(file: string, url: string, type: UploadTypes) {
debug('uploading file "%s" to "%s"', file, url);
const f = await readFile(file);
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"outputs": ["dist/**", ".next/**"],
"env": [
"DEBUG",
"CURRENTS_BATCHED_ORCHESTRATION",
"CURRENTS_ENFORCE_IS_CURRENTS",
"CURRENTS_PROJECT_ID",
"CURRENTS_API_URL",
"CURRENTS_RECORD_KEY",
Expand Down

0 comments on commit 90a8569

Please sign in to comment.