From b53df559d70ef82be3880579b7a32023eead9102 Mon Sep 17 00:00:00 2001 From: Tyler Jang Date: Fri, 3 Nov 2023 14:21:38 -0700 Subject: [PATCH] Disable sourcery tests (#547) 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. --- linters/sourcery/plugin.yaml | 4 ++++ linters/sourcery/sourcery.test.ts | 26 ++++++++++++++----------- linters/sourcery/test_data/_plugin.yaml | 3 +-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/linters/sourcery/plugin.yaml b/linters/sourcery/plugin.yaml index 0b19f8077..e0e0d61b5 100644 --- a/linters/sourcery/plugin.yaml +++ b/linters/sourcery/plugin.yaml @@ -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: diff --git a/linters/sourcery/sourcery.test.ts b/linters/sourcery/sourcery.test.ts index 090e397b8..86ac8c063 100644 --- a/linters/sourcery/sourcery.test.ts +++ b/linters/sourcery/sourcery.test.ts @@ -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) => { @@ -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); + // }, }); diff --git a/linters/sourcery/test_data/_plugin.yaml b/linters/sourcery/test_data/_plugin.yaml index dab319f01..539309625 100644 --- a/linters/sourcery/test_data/_plugin.yaml +++ b/linters/sourcery/test_data/_plugin.yaml @@ -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}