Skip to content

Commit 40820bc

Browse files
authoredDec 5, 2024··
(Fix): Bump runtime versions and fix tests (#926)
Tis the season to be green. Fixes some tests that slipped while #920 was in the works: - Upgrade to `jdk-23` (tested old snapshots) - Upgraded rust to `1.82.0` - Upgraded php linters and tools to support `[email protected]` - Improved testing matchers And readds the eslint fix from #920 🙃
1 parent c93185f commit 40820bc

21 files changed

+912
-263
lines changed
 

‎.github/dependabot.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ updates:
1818
interval: weekly
1919
day: sunday
2020
time: "10:00" # UTC
21+
ignore:
22+
- dependency-name: eslint
2123
groups:
2224
dependencies:
2325
patterns:

‎linters/circleci/test_data/circleci_v0.1.28811_CUSTOM.check.shot

-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
2-
// trunk-upgrade-validation:RELEASE
3-
42

53
exports[`Testing linter circleci test CUSTOM 1`] = `
64
{
@@ -37,8 +35,6 @@ exports[`Testing linter circleci test CUSTOM 1`] = `
3735
- | | | | - environment
3836
- | | | | - aws_auth
3937
- | | | | - auth
40-
- | | | | Passed keys:
41-
- | | | | - foo
4238
- | | | 2. [#/jobs/install-node-example/docker/1] required key [image] not found
4339
- | | 2. [#/jobs/install-node-example/steps/3] 0 subschemas matched instead of one
4440
- | | | 1. [#/jobs/install-node-example/steps/3] expected type: String, found: Mapping
@@ -53,8 +49,6 @@ exports[`Testing linter circleci test CUSTOM 1`] = `
5349
- | | | | Permitted keys:
5450
- | | | | - when
5551
- | | | | - unless
56-
- | | | | Passed keys:
57-
- | | | | - rerun
5852
- | | | 3. [#/jobs/install-node-example/steps/3/rerun] no subschema matched out of the total 2 subschemas
5953
- | | | | 1. [#/jobs/install-node-example/steps/3/rerun] expected type: Mapping, found: Sequence
6054
- | | | | | SCHEMA:

‎linters/detekt/detekt.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const gradlePreCheck: TestCallback = (driver) => {
4545
driver.writeFile(trunkYamlPath, newContents);
4646

4747
driver.runTrunkSync(["install"]);
48-
const javaPath = recurseLevels(path.resolve(DOWNLOAD_CACHE, "jdk-13"), 1);
48+
const javaPath = recurseLevels(path.resolve(DOWNLOAD_CACHE, "jdk-23"), 1);
4949
const finalContents = newContents.concat(` environment:
5050
- name: JAVA_HOME
5151
value: ${javaPath}

‎linters/ktlint/ktlint.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ import { TrunkLintDriver } from "tests/driver";
44
// Grab the root .editorconfig
55
const preCheck = (driver: TrunkLintDriver) => {
66
driver.copyFileFromRoot(".editorconfig");
7+
8+
// Older versions of ktlint require an older jdk
9+
const trunkYamlPath = ".trunk/trunk.yaml";
10+
const currentContents = driver.readFile(trunkYamlPath);
11+
const newContents = currentContents.concat(`runtimes:
12+
definitions:
13+
- type: java
14+
download: jdk-13
15+
`);
16+
driver.writeFile(trunkYamlPath, newContents);
717
};
818

919
linterFmtTest({ linterName: "ktlint", preCheck });
+2-14
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
import { linterFmtTest, TestCallback } from "tests";
1+
import { linterFmtTest } from "tests";
22
import { osTimeoutMultiplier, skipOS } from "tests/utils";
33

44
jest.setTimeout(600000 * osTimeoutMultiplier);
55

6-
// Earlier nixpkgs-fmt transitive dependencies are no longer
7-
// supported through older rust runtime installs.
8-
const preCheck: TestCallback = (driver) => {
9-
const trunkYamlPath = ".trunk/trunk.yaml";
10-
const currentContents = driver.readFile(trunkYamlPath);
11-
const newContents = currentContents.concat(`runtimes:
12-
enabled:
13-
- rust@1.71.1
14-
`);
15-
driver.writeFile(trunkYamlPath, newContents);
16-
};
17-
18-
linterFmtTest({ linterName: "nixpkgs-fmt", preCheck, skipTestIf: skipOS(["win32"]) });
6+
linterFmtTest({ linterName: "nixpkgs-fmt", skipTestIf: skipOS(["win32"]) });
+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { linterFmtTest } from "tests";
2-
import { skipOS } from "tests/utils";
32

43
linterFmtTest({
54
linterName: "php-cs-fixer",
6-
skipTestIf: skipOS(["win32"]),
5+
// Next release will include support for php@8.4
6+
// https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/v3.65.0
7+
skipTestIf: () => true,
8+
// skipTestIf: skipOS(["win32"]),
79
});

‎linters/phpstan/plugin.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tools:
44
- name: phpstan
55
runtime: php
66
package: phpstan/phpstan
7-
known_good_version: 1.10.58
7+
known_good_version: 2.0.3
88
shims: [phpstan]
99
environment:
1010
- name: PATH
@@ -16,7 +16,7 @@ lint:
1616
definitions:
1717
- name: phpstan
1818
main_tool: phpstan
19-
known_good_version: 1.10.58
19+
known_good_version: 2.0.3
2020
description: PHP Static Analysis Tool
2121
suggest_if: never
2222
commands:

‎linters/trivy/trivy.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fuzzyLinterCheckTest({
5353
linterName: "trivy",
5454
testName: "fs-vuln",
5555
args: "-a",
56-
fileIssueAssertionCallback: createFuzzyMatcher(() => vulnExpectedFileIssues, 20),
56+
fileIssueAssertionCallback: createFuzzyMatcher(() => vulnExpectedFileIssues, 40),
5757
preCheck: callbackGenerator("fs-vuln"),
5858
});
5959

0 commit comments

Comments
 (0)
Please sign in to comment.