Skip to content

Commit

Permalink
Address my own comments
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardopirovano committed Sep 4, 2024
1 parent 04a1672 commit 829dde1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cloud-compute/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ inputs:
admin:
api-token: {{ secrets.METICULOUS_ADMIN_API_TOKEN }}
app-url: "http://localhost:4000"
skip: {{ secrets.METICULOUS_APP_API_TOKEN }}
skip: false (optional, default is false)
```
required: false

Expand Down
4 changes: 2 additions & 2 deletions out/cloud-compute.entrypoint.js

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

3 changes: 1 addition & 2 deletions src/actions/cloud-compute/cloud-compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export const runMeticulousTestsCloudComputeAction = async (): Promise<void> => {
// This will be the case when the user provides `app-url` and `api-token` inputs directly.
// This is used to simplify some of the logging and error handling.
const isSingleTestRunExecution =
projectTargetsToRun.length === 1 &&
projectTargetsToRun[0].name === "default";
projectTargets.length === 1 && projectTargets[0].name === "default";

// Log skipped targets, if any
if (skippedTargets) {
Expand Down
2 changes: 1 addition & 1 deletion src/actions/cloud-compute/consts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Duration } from "luxon";

export const DEBUG_MODE_KEEP_TUNNEL_OPEN_DURAION = Duration.fromObject({
export const DEBUG_MODE_KEEP_TUNNEL_OPEN_DURATION = Duration.fromObject({
minutes: 45,
});
10 changes: 5 additions & 5 deletions src/actions/cloud-compute/run-test-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from "../../common/logger.utils";
import { getOctokitOrFail } from "../../common/octokit";
import { updateStatusComment } from "../../common/update-status-comment";
import { DEBUG_MODE_KEEP_TUNNEL_OPEN_DURAION } from "./consts";
import { DEBUG_MODE_KEEP_TUNNEL_OPEN_DURATION } from "./consts";
import { getCloudComputeBaseTestRun } from "./get-cloud-compute-base-test-run";

export const runOneTestRun = async ({
Expand Down Expand Up @@ -54,7 +54,7 @@ export const runOneTestRun = async ({
if (!project) {
throw new Error(
`Could not retrieve project data${
isSingleTestRunExecution ? "" : `for project ${testRunId}`
isSingleTestRunExecution ? "" : ` for project ${testRunId}`
}. Is the API token correct?`
);
}
Expand Down Expand Up @@ -152,7 +152,7 @@ export const runOneTestRun = async ({
owner,
repo,
body: `🤖 Meticulous is running in debug mode. Secure tunnel to ${appUrl} created: ${url} user: \`${basicAuthUser}\` password: \`${basicAuthPassword}\`.\n\n
Tunnel will be live for up to ${DEBUG_MODE_KEEP_TUNNEL_OPEN_DURAION.toHuman()}. Cancel the workflow run to close the tunnel early.`,
Tunnel will be live for up to ${DEBUG_MODE_KEEP_TUNNEL_OPEN_DURATION.toHuman()}. Cancel the workflow run to close the tunnel early.`,
testSuiteId: `__meticulous_debug_${testRunId}__`,
shortHeadSha: shortCommitSha(headSha),
createIfDoesNotExist: true,
Expand All @@ -175,11 +175,11 @@ Tunnel will be live for up to ${DEBUG_MODE_KEEP_TUNNEL_OPEN_DURAION.toHuman()}.
!keepTunnelOpenTimeout
) {
logger.info(
`Test run execution completed. Keeping tunnel open for ${DEBUG_MODE_KEEP_TUNNEL_OPEN_DURAION.toHuman()}`
`Test run execution completed. Keeping tunnel open for ${DEBUG_MODE_KEEP_TUNNEL_OPEN_DURATION.toHuman()}`
);
keepTunnelOpenTimeout = setTimeout(() => {
keepTunnelOpenPromise.resolve();
}, DEBUG_MODE_KEEP_TUNNEL_OPEN_DURAION.as("milliseconds"));
}, DEBUG_MODE_KEEP_TUNNEL_OPEN_DURATION.as("milliseconds"));
}

const numTestCases = testRun.configData.testCases?.length || 0;
Expand Down

0 comments on commit 829dde1

Please sign in to comment.