Closed TWiStErRob closed 11 months ago
Describe the bug If one job starts a group, and another logs while that group is open, then the parser crashes with:
Cannot read properties of undefined (reading 'output') TypeError: Cannot read properties of undefined (reading 'output') at OutputParser.parseStepOutput (node_modules/@kie/act-js/build/src/output-parser/output-parser.js:119:61) at OutputParser.parseOutput (node_modules/@kie/act-js/build/src/output-parser/output-parser.js:26:18)
this.groupMatrix[stepOutputMatcherResult[1]][length - 1].output += ... ^ LHS undefined
this.groupMatrix[stepOutputMatcherResult[1]] === [], therefore length is 0, and ...[-1] === undefined.
this.groupMatrix[stepOutputMatcherResult[1]] === []
length
...[-1] === undefined
To Reproduce
test("original", async () => { const contents = await fs.readFile("act.log"); console.log(new OutputParser(contents.toString()).parseOutput()); });
act.log:
act.log
[Build/Tests ] ⭐ Run Main Testing [Build/Tests ] ❓ ::group::Unit Tests [Build/Static Analysis ] ⭐ Run Main Lint [Build/Static Analysis ] | No problems found. [Build/Tests ] | 1231 tests executed. [Build/Tests ] ❓ ::endgroup:: [Build/Tests ] ❓ ::group::Integration Tests [Build/Tests ] | 32 tests executed. [Build/Tests ] ❓ ::endgroup:: [Build/Static Analysis ] ✅ Success - Main Linting [Build/Tests ] ✅ Success - Main Testing
Expected behavior "Just works".
Logs
Additional context Looking at output-parser.js, as far as I see .isPartOfGroup is handled on the parser level, but it should per-job.
.isPartOfGroup
Can you please release this?
Done!
Describe the bug If one job starts a group, and another logs while that group is open, then the parser crashes with:
this.groupMatrix[stepOutputMatcherResult[1]] === []
, thereforelength
is 0, and...[-1] === undefined
.To Reproduce
act.log
:Expected behavior "Just works".
Logs
Distilled real log focused on the issue
``` [Android Build/Unit Tests ] 🚀 Start image=ghcr.io/catthehacker/ubuntu:act-latest [Android Build/Android Lint ] 🚀 Start image=ghcr.io/catthehacker/ubuntu:act-latest [Android Build/Unit Tests ] ⭐ Run Main Set up Android SDK. [Android Build/Unit Tests ] 🐳 docker cp src=/home/runner/.cache/act/android-actions-setup-android@v3/ dst=/var/run/act/actions/android-actions-setup-android@v3/ [Android Build/Android Lint ] ⭐ Run Main Set up Android SDK. [Android Build/Android Lint ] 🐳 docker cp src=/home/runner/.cache/act/android-actions-setup-android@v3/ dst=/var/run/act/actions/android-actions-setup-android@v3/ [Android Build/Android Lint ] | [command]/root/.android/sdk/cmdline-tools/11.0/bin/sdkmanager tools [Android Build/Unit Tests ] | [command]/root/.android/sdk/cmdline-tools/11.0/bin/sdkmanager tools [Android Build/Android Lint ] | [command]/root/.android/sdk/cmdline-tools/11.0/bin/sdkmanager platform-tools [Android Build/Android Lint ] ❓ add-matcher /run/act/actions/android-actions-setup-android@v3/matchers.json [Android Build/Android Lint ] ✅ Success - Main Set up Android SDK. [Android Build/Android Lint ] ⭐ Run Main Set up Java for Project. [Android Build/Android Lint ] 🐳 docker cp src=/home/runner/.cache/act/actions-setup-java@v3/ dst=/var/run/act/actions/actions-setup-java@v3/ [Android Build/Android Lint ] ❓ ::group::Installed distributions [Android Build/Android Lint ] | Resolved Java 17.0.9+9 from tool-cache [Android Build/Unit Tests ] | [command]/root/.android/sdk/cmdline-tools/11.0/bin/sdkmanager platform-tools [Android Build/Android Lint ] | Path: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.9-9/x64 [Android Build/Android Lint ] ❓ ::endgroup:: [Android Build/Android Lint ] ✅ Success - Main Set up Java for Project. [Android Build/Unit Tests ] ❓ add-matcher /run/act/actions/android-actions-setup-android@v3/matchers.json [Android Build/Unit Tests ] ✅ Success - Main Set up Android SDK. ```Additional context Looking at output-parser.js, as far as I see
.isPartOfGroup
is handled on the parser level, but it should per-job.