Compare commits

..

3 Commits
v4.3.1 ... main

Author SHA1 Message Date
Renner 61fd9aa167
Provide descriptive activation information on error (#296)
When trying to activate using Unity.Licensing.Client, any errors will
provide no output. This change makes sure to provide context as to why
the Unity.Licensing.Client has failed to retrieve a license.

Signed-off-by: J. Renner <joao.renner@virtualisurg.com>
2025-08-01 13:26:43 -05:00
Gabriel Le Breton 0483262850
Add warning for invalid nunit xml files (#286)
* Allow ResultsParser to fail on non-nunit xml files

* yarn build

* Add file check for NUnit XML format before parsing

* yarn build

* Update src/model/results-check.ts

Co-authored-by: Koji Hasegawa <hasegawa@nowsprinting.com>

---------

Co-authored-by: Koji Hasegawa <hasegawa@nowsprinting.com>
2024-11-08 23:43:21 +01:00
Joe Anderson 05a00ef5ac
Fix: Debug.LogError annotation point not parsed correctly (#279) 2024-07-20 14:25:59 -05:00
6 changed files with 1374 additions and 1338 deletions

2671
dist/index.js generated vendored

File diff suppressed because it is too large Load Diff

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -65,7 +65,14 @@ elif [[ -n "$UNITY_LICENSING_SERVER" ]]; then
FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE")
FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE")
echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT"
if [[ -z "$FLOATING_LICENSE" || -z "$FLOATING_LICENSE_TIMEOUT" ]]; then
echo "::error ::Failed to acquire floating license from Unity Licensing Server."
echo "Check the activation log below for more details."
cat license.txt
else
echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT"
fi
# Store the exit code from the verify command
else
#

View File

@ -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}`);
}
}),
);

View File

@ -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);
});
});
});

View File

@ -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,