Skip to content

Commit

Permalink
undo variable extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
danadajian committed Nov 25, 2024
1 parent 781a97c commit 00b2d7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
description: 'The commit hash'
required: false
diff-id:
description: 'Alternative to commit-hash as a unique identifier for visual tests.'
description: 'Alternative to commit-hash as a unique identifier for visual tests. GitHub integration will be disabled if diff-id is used.'
required: false
screenshots-directory:
description: 'The directory where your visual tests expect screenshots to be'
Expand Down
10 changes: 4 additions & 6 deletions action/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ import {
import { buildComparadiseUrl } from './build-comparadise-url';
import { disableAutoMerge } from './disable-auto-merge';

const VISUAL_TEST_EXECUTION_FAILURE =
'Visual tests failed to execute successfully. Perhaps one failed to take a screenshot?';
const VISUAL_TESTS_PASSED = 'All visual tests passed, and no diffs found!';

export const run = async () => {
const runAttempt = Number(process.env.GITHUB_RUN_ATTEMPT);
const isRetry = runAttempt > 1;
Expand Down Expand Up @@ -78,7 +74,9 @@ export const run = async () => {
const newFileCount = newFilePaths.length;

if (numVisualTestFailures > diffFileCount) {
setFailed(VISUAL_TEST_EXECUTION_FAILURE);
setFailed(
'Visual tests failed to execute successfully. Perhaps one failed to take a screenshot?'
);
if (!commitHash) return;
return octokit.rest.repos.createCommitStatus({
sha: commitHash,
Expand All @@ -94,7 +92,7 @@ export const run = async () => {
: null;

if (diffFileCount === 0 && newFileCount === 0) {
info(VISUAL_TESTS_PASSED);
info('All visual tests passed, and no diffs found!');

if (!commitHash) return;
if (isRetry) {
Expand Down

0 comments on commit 00b2d7d

Please sign in to comment.