Skip to content

Commit

Permalink
Disable sourcery tests (#547)
Browse files Browse the repository at this point in the history
Due to changes in sourcery's pricing model, sourcery can no longer be
run with Trunk in their free tier. I'm disabling the tests until we have
a more robust solution.
  • Loading branch information
TylerJang27 authored Nov 3, 2023
1 parent efe8cf8 commit b53df55
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
4 changes: 4 additions & 0 deletions linters/sourcery/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ lint:
batch: true
# NOTE(Tyler): Autofixes will show up as complete "formatting-like" diagnostics. However, strictly speaking, this isn't a formatter, so we don't want to set formatter: true
in_place: true
environment:
- name: PATH
# needs system path for license verification
list: ["${linter}", "${env.PATH}"]
tools: [sourcery]
suggest_if: never
direct_configs:
Expand Down
26 changes: 15 additions & 11 deletions linters/sourcery/sourcery.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from "path";
import { linterCheckTest } from "tests";
import { TrunkLintDriver } from "tests/driver";
import { skipCPUOS, TEST_DATA } from "tests/utils";
import { TEST_DATA } from "tests/utils";

// // You must login in order to use sourcery
const preCheck = (driver: TrunkLintDriver) => {
Expand All @@ -23,14 +23,18 @@ lint:`,
linterCheckTest({
linterName: "sourcery",
preCheck,
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);
},
// TODO(Tyler): Sourcery's new pricing model means that we can no longer run trunk+sourcery
// in sandboxes with their open source tier. Disable this test until we have a robust solution.
skipTestIf: () => true,
// skipTestIf: (version) => {
// return true;
// 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);
// },
});
3 changes: 1 addition & 2 deletions linters/sourcery/test_data/_plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ lint:
- name: fix
prepare_run: bash -c "sourcery login --token=${SOURCERY_TOKEN}"
environment:
# TODO(Tyler): Once prepare_run supports proper environment template resolution, remove PATH and bash
- name: PATH
list: ["${env.PATH}"]
list: ["${linter}", "${env.PATH}"]
- name: SOURCERY_TOKEN
value: ${env.SOURCERY_TOKEN}

0 comments on commit b53df55

Please sign in to comment.