Skip to content

Commit

Permalink
Fix eslint test packages and setup (#564)
Browse files Browse the repository at this point in the history
Our eslint execution isn't super LUV-faithful, but regardless this was
starting to fail on older versions. This fix will unblock eslint
snapshot version tests. Fixes errors seen
[here](https://github.com/trunk-io/trunk/actions/runs/6927792518/job/18842336047).
  • Loading branch information
TylerJang27 committed Nov 20, 2023
1 parent 9742b86 commit a0bbbab
Show file tree
Hide file tree
Showing 9 changed files with 2,877 additions and 21 deletions.
3 changes: 2 additions & 1 deletion linters/brakeman/brakeman.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { osTimeoutMultiplier, skipOS, TEST_DATA } from "tests/utils";

// Note that the ruby setup can sometimes take a while.
// Ruby build is quite slow on Mac, so only run tests on linux for now
jest.setTimeout(300000 * osTimeoutMultiplier); // 300s or 900s
jest.setTimeout(600000 * osTimeoutMultiplier); // 300s or 900s

customLinterCheckTest({
linterName: "brakeman",
args: TEST_DATA,
Expand Down
4 changes: 2 additions & 2 deletions linters/eslint/eslint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { osTimeoutMultiplier, TEST_DATA } from "tests/utils";
const INSTALL_TIMEOUT = 150000 * osTimeoutMultiplier;

const moveConfig = (driver: TrunkLintDriver) => {
[".eslintrc.yaml", "package.json"].forEach((file) => {
[".eslintrc.yaml", "package.json", "package-lock.json"].forEach((file) => {
// trunk-ignore(semgrep): paths used here are safe
driver.moveFile(path.join(TEST_DATA, file), file);
});
Expand Down Expand Up @@ -41,7 +41,7 @@ const preCheck = (driver: TrunkLintDriver) => {
process.platform == "win32" ? "npm.bat" : "npm",
),
// trunk-ignore-end(semgrep)
["install"],
["ci"],
{
cwd: driver.getSandbox(),
timeout: INSTALL_TIMEOUT,
Expand Down
18 changes: 9 additions & 9 deletions linters/eslint/test_data/eslint_v8.10.0_CUSTOM.check.shot
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exports[`Testing linter eslint test CUSTOM 1`] = `
"column": "10",
"file": "test_data/format_imports.ts",
"issueUrl": "https://eslint.org/docs/rules/@typescript-eslint/no-unused-vars",
"level": "LEVEL_MEDIUM",
"level": "LEVEL_HIGH",
"line": "2",
"linter": "eslint",
"message": "'zaphod' is defined but never used.",
Expand Down Expand Up @@ -63,7 +63,7 @@ exports[`Testing linter eslint test CUSTOM 1`] = `
"column": "10",
"file": "test_data/format_imports.ts",
"issueUrl": "https://eslint.org/docs/rules/@typescript-eslint/no-unused-vars",
"level": "LEVEL_MEDIUM",
"level": "LEVEL_HIGH",
"line": "3",
"linter": "eslint",
"message": "'arthur' is defined but never used.",
Expand Down Expand Up @@ -107,7 +107,7 @@ exports[`Testing linter eslint test CUSTOM 1`] = `
"column": "10",
"file": "test_data/format_imports.ts",
"issueUrl": "https://eslint.org/docs/rules/@typescript-eslint/no-unused-vars",
"level": "LEVEL_MEDIUM",
"level": "LEVEL_HIGH",
"line": "4",
"linter": "eslint",
"message": "'ford' is defined but never used.",
Expand Down Expand Up @@ -162,7 +162,7 @@ exports[`Testing linter eslint test CUSTOM 1`] = `
"column": "36",
"file": "test_data/null_rule_id.ts",
"issueUrl": "https://eslint.org/docs/rules/@typescript-eslint/no-explicit-any",
"level": "LEVEL_MEDIUM",
"level": "LEVEL_HIGH",
"line": "16",
"linter": "eslint",
"message": "Unexpected any. Specify a different type.",
Expand All @@ -173,7 +173,7 @@ exports[`Testing linter eslint test CUSTOM 1`] = `
"column": "53",
"file": "test_data/null_rule_id.ts",
"issueUrl": "https://eslint.org/docs/rules/@typescript-eslint/no-explicit-any",
"level": "LEVEL_MEDIUM",
"level": "LEVEL_HIGH",
"line": "16",
"linter": "eslint",
"message": "Unexpected any. Specify a different type.",
Expand All @@ -184,7 +184,7 @@ exports[`Testing linter eslint test CUSTOM 1`] = `
"column": "60",
"file": "test_data/null_rule_id.ts",
"issueUrl": "https://eslint.org/docs/rules/@typescript-eslint/no-explicit-any",
"level": "LEVEL_MEDIUM",
"level": "LEVEL_HIGH",
"line": "16",
"linter": "eslint",
"message": "Unexpected any. Specify a different type.",
Expand All @@ -206,7 +206,7 @@ exports[`Testing linter eslint test CUSTOM 1`] = `
"column": "54",
"file": "test_data/null_rule_id.ts",
"issueUrl": "https://eslint.org/docs/rules/@typescript-eslint/no-explicit-any",
"level": "LEVEL_MEDIUM",
"level": "LEVEL_HIGH",
"line": "17",
"linter": "eslint",
"message": "Unexpected any. Specify a different type.",
Expand All @@ -228,7 +228,7 @@ exports[`Testing linter eslint test CUSTOM 1`] = `
"column": "42",
"file": "test_data/null_rule_id.ts",
"issueUrl": "https://eslint.org/docs/rules/@typescript-eslint/no-explicit-any",
"level": "LEVEL_MEDIUM",
"level": "LEVEL_HIGH",
"line": "18",
"linter": "eslint",
"message": "Unexpected any. Specify a different type.",
Expand All @@ -239,7 +239,7 @@ exports[`Testing linter eslint test CUSTOM 1`] = `
"column": "49",
"file": "test_data/null_rule_id.ts",
"issueUrl": "https://eslint.org/docs/rules/@typescript-eslint/no-explicit-any",
"level": "LEVEL_MEDIUM",
"level": "LEVEL_HIGH",
"line": "18",
"linter": "eslint",
"message": "Unexpected any. Specify a different type.",
Expand Down

0 comments on commit a0bbbab

Please sign in to comment.