Skip to content

Commit 39aee20

Browse files
test: Fix integration tests on main OD-969 (#212)
Token test now uses a project token (account token expired) and fixtures match current Codacy/trivy output. BSD awk lacks \s, so eslint/tool-list normalizers matched nothing and passed vacuously on macOS.
1 parent 473b61c commit 39aee20

12 files changed

Lines changed: 32575 additions & 28280 deletions

File tree

‎.github/workflows/it-test.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ jobs:
7474
exit $LASTEXITCODE
7575
}
7676
env:
77-
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
77+
CODACY_CLI_TEST_PROJECT_TOKEN: ${{ secrets.CODACY_CLI_TEST_PROJECT_TOKEN }}
7878

7979
- name: Run init tests on Unix
8080
if: matrix.os != 'windows-latest'
8181
id: run_init_tests_unix
8282
continue-on-error: true
8383
shell: bash
8484
env:
85-
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
85+
CODACY_CLI_TEST_PROJECT_TOKEN: ${{ secrets.CODACY_CLI_TEST_PROJECT_TOKEN }}
8686
run: |
8787
chmod +x integration-tests/run.sh
8888
./integration-tests/run.sh

‎integration-tests/config-discover/expected/tools-configs/ruleset.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
<rule ref="category/java/errorprone.xml/AvoidInstanceofChecksInCatchClause"/>
9090
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
9191
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
92-
<rule ref="category/java/errorprone.xml/CheckSkipResult"/>
9392
<rule ref="category/java/errorprone.xml/CompareObjectsWithEquals">
9493
<properties>
9594
<property name="typesThatCompareByReference" value="java.lang.Enum,java.lang.Class"/>

‎integration-tests/init-with-token/expected/tools-configs/eslint.config.mjs‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,52 @@ export default [
22
{
33
files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.mjs", "**/*.cjs", "**/*.vue"],
44
rules: {
5+
"valid-typeof": ["error"],
6+
"use-isnan": ["error"],
7+
"no-useless-backreference": ["error"],
8+
"no-unsafe-optional-chaining": ["error"],
9+
"no-unsafe-negation": ["error"],
10+
"no-unsafe-finally": ["error"],
11+
"no-unreachable": ["error"],
12+
"no-unexpected-multiline": ["error"],
13+
"no-undef": ["error"],
14+
"no-this-before-super": ["error"],
15+
"no-script-url": ["error"],
16+
"no-redeclare": ["error"],
17+
"no-prototype-builtins": ["error"],
18+
"no-octal": ["error"],
19+
"no-obj-calls": ["error"],
20+
"no-new-native-nonconstructor": ["error"],
21+
"no-misleading-character-class": ["error"],
22+
"no-loss-of-precision": ["error"],
23+
"no-invalid-regexp": ["error"],
24+
"no-import-assign": ["error"],
25+
"no-implied-eval": ["error"],
26+
"no-global-assign": ["error"],
27+
"no-func-assign": ["error"],
28+
"no-fallthrough": ["error"],
29+
"no-ex-assign": ["error"],
30+
"no-eval": ["error"],
31+
"no-empty-pattern": ["error"],
32+
"no-empty-character-class": ["error"],
33+
"no-duplicate-case": ["error"],
34+
"no-dupe-keys": ["error"],
35+
"no-dupe-else-if": ["error"],
36+
"no-dupe-class-members": ["error"],
37+
"no-dupe-args": ["error"],
38+
"no-delete-var": ["error"],
39+
"no-debugger": ["error"],
40+
"no-constant-condition": ["error"],
41+
"no-constant-binary-expression": ["error"],
42+
"no-const-assign": ["error"],
43+
"no-cond-assign": ["error"],
44+
"no-compare-neg-zero": ["error"],
45+
"no-class-assign": ["error"],
46+
"no-buffer-constructor": ["error"],
47+
"no-async-promise-executor": ["error"],
48+
"getter-return": ["error"],
49+
"for-direction": ["error"],
50+
"constructor-super": ["error"],
551
}
652
}
753
];

‎integration-tests/init-with-token/expected/tools-configs/languages-config.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ tools:
1212
extensions: [.java, .js, .jsm, .jsx, .mjs, .py, .ts, .tsx, .vue]
1313
files: []
1414
- name: pmd
15-
languages: [Java, Javascript]
16-
extensions: [.java, .js, .jsm, .jsx, .mjs, .vue]
15+
languages: [Java, Javascript, TypeScript]
16+
extensions: [.java, .js, .jsm, .jsx, .mjs, .ts, .tsx, .vue]
1717
files: []
1818
- name: pylint
1919
languages: [Python]
@@ -22,4 +22,4 @@ tools:
2222
- name: trivy
2323
languages: [JSON, Java, Javascript, Python, TypeScript]
2424
extensions: [.java, .js, .jsm, .json, .jsx, .mjs, .py, .ts, .tsx, .vue]
25-
files: [Pipfile.lock, gradle.lockfile, package-lock.json, package.json, pnpm-lock.yaml, poetry.lock, pom.xml, requirements.txt, uv.lock, yarn.lock]
25+
files: [Pipfile.lock, gradle.lockfile, package-lock.json, package.json, pnpm-lock.yaml, poetry.lock, pom.xml, requirements.txt, uv.lock, yarn.lock]

‎integration-tests/init-with-token/expected/tools-configs/lizard.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ patterns:
99
id: Lizard_ccn-minor
1010
level: Info
1111
severityLevel: Info
12-
threshold: 10
12+
threshold: 40
1313
timeToFix: 5
1414
title: Limit Function Cyclomatic Complexity (Minor)
1515
Lizard_nloc-critical:
@@ -35,6 +35,6 @@ patterns:
3535
id: Lizard_nloc-medium
3636
level: Warning
3737
severityLevel: Warning
38-
threshold: 50
38+
threshold: 100
3939
timeToFix: 10
4040
title: Limit Function Length (Medium)

‎integration-tests/init-with-token/expected/tools-configs/pylint.rc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ load-plugins=
55

66
[MESSAGES CONTROL]
77
disable=all
8-
enable=E1124,E1130,E1133
8+
enable=E0203,E0102,E1102,E1121,E1133,E0241,W0101,E0107,E0202,E1003,E0302,E1306,E0113,E0301,W0711,E0108,E0604,W0102,E0603,W0150,E0240,E0101,E0110,E0112,E0117,E0211,E1303,W0123,E1130,E0106,E1300,E0105,E1200,W0109,W1306,E0236,E0712,E0710,E1301,E0104,E0702,E1132,W0221,E0701,E1206,E0238,E1126,E0114,W0702,E0100,W0106,E0601,W1307,E1302,E1125,W0622,E1111,E1305,E0103,W0410,E0115,E1304,E1123,W0233,W1303,W0199,E1124,E0704,W0601,E0239,E1120,W1302,W0222,E0711,W1300,E1201,W0122,E1127
99

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
<?xml version="1.0"?>
2-
<ruleset name="Codacy PMD Ruleset"
3-
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="Codacy PMD 7 Ruleset"
3+
xmlns="https://pmd.github.io/ruleset/2.0.0"
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
6-
<description>Codacy PMD Ruleset</description>
7-
<rule ref="category/apex/design.xml/ExcessivePublicCount"/>
8-
<rule ref="category/java/bestpractices.xml/JUnitTestsShouldIncludeAssert"/>
9-
<rule ref="category/java/codestyle.xml/ShortMethodName"/>
10-
<rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic"/>
11-
</ruleset>
5+
xsi:schemaLocation="https://pmd.github.io/ruleset/2.0.0 https://pmd.github.io/schemas/pmd-7.0.0.xsd">
6+
<description>Codacy PMD 7 Ruleset</description></ruleset>

0 commit comments

Comments
 (0)