mirror of
https://github.com/game-ci/unity-test-runner.git
synced 2026-01-29 06:20:07 +08:00
Compare commits
5 Commits
v4.3.0
...
snyk-upgra
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c20810d620 | ||
|
|
0483262850 | ||
|
|
05a00ef5ac | ||
|
|
0ff419b913 | ||
|
|
e0e796f3d9 |
@@ -45,7 +45,7 @@ GameCI is free for everyone forever.
|
||||
|
||||
You can support us at [OpenCollective](https://opencollective.com/game-ci).
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This repository is [MIT](./LICENSE) licensed.
|
||||
|
||||
|
||||
2669
dist/index.js
generated
vendored
2669
dist/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -15,7 +15,7 @@
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/github": "^5.0.0",
|
||||
"@octokit/openapi-types": "^11.2.0",
|
||||
|
||||
@@ -22,9 +22,18 @@ const ResultsCheck = {
|
||||
files.map(async filepath => {
|
||||
if (!filepath.endsWith('.xml')) return;
|
||||
core.info(`Processing file ${filepath}...`);
|
||||
const fileData = await ResultsParser.parseResults(path.join(artifactsPath, filepath));
|
||||
core.info(fileData.summary);
|
||||
runs.push(fileData);
|
||||
try {
|
||||
const content = fs.readFileSync(path.join(artifactsPath, filepath), 'utf8');
|
||||
if (!content.includes('<test-run')) {
|
||||
// noinspection ExceptionCaughtLocallyJS
|
||||
throw new Error('File does not appear to be a NUnit XML file');
|
||||
}
|
||||
const fileData = await ResultsParser.parseResults(path.join(artifactsPath, filepath));
|
||||
core.info(fileData.summary);
|
||||
runs.push(fileData);
|
||||
} catch (error: any) {
|
||||
core.warning(`Failed to parse ${filepath}: ${error.message}`);
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -76,10 +85,12 @@ const ResultsCheck = {
|
||||
const pullRequest = github.context.payload.pull_request;
|
||||
const headSha = (pullRequest && pullRequest.head.sha) || github.context.sha;
|
||||
|
||||
// Check max length for https://github.com/game-ci/unity-test-runner/issues/214
|
||||
const maxLength = 65_534;
|
||||
if (output.length > maxLength) {
|
||||
core.warning(`Output too long (${output.length}) truncating to ${maxLength}`);
|
||||
output = output.slice(0, maxLength);
|
||||
if (output.text.length > maxLength) {
|
||||
core.warning(`Test details of ${output.text.length} surpass limit of ${maxLength}`);
|
||||
output.text =
|
||||
'Test details omitted from GitHub UI due to length. See console logs for details.';
|
||||
}
|
||||
|
||||
core.info(`Posting results for ${headSha}`);
|
||||
|
||||
@@ -248,5 +248,13 @@ at Tests.SetupFailedTest.SetUp () [0x00000] in /github/workspace/unity-project/A
|
||||
expect(result.path).toBe('/github/workspace/unity-project/Assets/Tests/SetupFailedTest.cs');
|
||||
expect(result.line).toBe(10);
|
||||
});
|
||||
|
||||
test('Debug.LogError annotation point', () => {
|
||||
const result = ResultsParser.findAnnotationPoint(
|
||||
`FMODUnity.RuntimeUtils:DebugLogError (string) (at Assets/Plugins/FMOD/src/RuntimeUtils.cs:580)`,
|
||||
);
|
||||
expect(result.path).toBe('Assets/Plugins/FMOD/src/RuntimeUtils.cs');
|
||||
expect(result.line).toBe(580);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -127,12 +127,13 @@ const ResultsParser = {
|
||||
},
|
||||
|
||||
findAnnotationPoint(trace) {
|
||||
const regex = /at(?: .* in)? ((?<path>[^:]+):(?<line>\d+))/;
|
||||
// Find first entry with non-zero line number in stack trace
|
||||
const items = trace.match(/at .* in ((?<path>[^:]+):(?<line>\d+))/g);
|
||||
const items = trace.match(new RegExp(regex, 'g'));
|
||||
if (Array.isArray(items)) {
|
||||
const result: { path: any; line: number }[] = [];
|
||||
for (const item of items) {
|
||||
const match = item.match(/at .* in ((?<path>[^:]+):(?<line>\d+))/);
|
||||
const match = item.match(regex);
|
||||
const point = {
|
||||
path: match ? match.groups.path : '',
|
||||
line: match ? Number(match.groups.line) : 0,
|
||||
@@ -146,7 +147,7 @@ const ResultsParser = {
|
||||
}
|
||||
}
|
||||
// If all entries have zero line number match fallback pattern
|
||||
const match = trace.match(/at .* in ((?<path>[^:]+):(?<line>\d+))/);
|
||||
const match = trace.match(regex);
|
||||
return {
|
||||
path: match ? match.groups.path : '',
|
||||
line: match ? Number(match.groups.line) : 0,
|
||||
|
||||
14
yarn.lock
14
yarn.lock
@@ -2,15 +2,15 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@actions/core@^1.10.0":
|
||||
version "1.10.0"
|
||||
resolved "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz"
|
||||
integrity sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==
|
||||
"@actions/core@^1.11.1":
|
||||
version "1.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.11.1.tgz#ae683aac5112438021588030efb53b1adb86f172"
|
||||
integrity sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==
|
||||
dependencies:
|
||||
"@actions/exec" "^1.1.1"
|
||||
"@actions/http-client" "^2.0.1"
|
||||
uuid "^8.3.2"
|
||||
|
||||
"@actions/exec@^1.1.0":
|
||||
"@actions/exec@^1.1.0", "@actions/exec@^1.1.1":
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz"
|
||||
integrity sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==
|
||||
@@ -5738,7 +5738,7 @@ use@^3.1.0:
|
||||
resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz"
|
||||
integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==
|
||||
|
||||
uuid@^8.3.0, uuid@^8.3.2:
|
||||
uuid@^8.3.0:
|
||||
version "8.3.2"
|
||||
resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz"
|
||||
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
|
||||
|
||||
Reference in New Issue
Block a user