Skip to content

Commit

Permalink
Skip sourcery linter tests (#521)
Browse files Browse the repository at this point in the history
Prevent linter sourcery tests from running when the token is not set.
This is designed to make local development simpler and allow for a
better experience from
[forks](#517), where the secrets
aren't available. Adds a log if the test is skipped.

Tested on #520.
  • Loading branch information
TylerJang27 committed Oct 11, 2023
1 parent 8ce453d commit f87c0d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion linters/sourcery/sourcery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,14 @@ lint:`,
linterCheckTest({
linterName: "sourcery",
preCheck,
skipTestIf: skipCPUOS([{ os: "linux", cpu: "arm64" }]),
skipTestIf: (version) => {
if (!process.env.SOURCERY_TOKEN) {
// NOTE(Tyler): This is the simplest approach in order to streamline local development and running from forks.
console.log(
"Skipping sourcery test. Must provide SOURCERY_TOKEN environment variable in order to run.",
);
return true;
}
return skipCPUOS([{ os: "linux", cpu: "arm64" }])(version);
},
});

0 comments on commit f87c0d0

Please sign in to comment.