Skip to content

Commit eb23fb4

Browse files
committed
Test GHA test fixes
1 parent f08027c commit eb23fb4

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.github/workflows/build-dev-win64.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ jobs:
1919
- run: npm install --production --ignore-scripts
2020
- run: npm install --production
2121
working-directory: nexe
22-
# diagnose weird execution failure
22+
# workaround issue https://github.com/nodejs/node/issues/52681#issuecomment-2076426887
2323
- run: |
24-
(Get-Content -Path "node_modules/nexe/lib/compiler.js" -Raw) -replace 'child_process_1.spawn', 'this.log.step(''Executing ''+command+'' ''+args);child_process_1.spawn' | Set-Content -Path "node_modules/nexe/lib/compiler.js"
2524
(Get-Content -Path "node_modules/nexe/lib/compiler.js" -Raw) -replace 'cwd: this.src,', 'shell: true, cwd: this.src,' | Set-Content -Path "node_modules/nexe/lib/compiler.js"
2625
working-directory: nexe
2726
- run: node build

.github/workflows/test-full.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
name: Test on Node v${{ matrix.version }}
2525
runs-on: ubuntu-latest
2626
steps:
27+
- run: sudo apt-get install -y gdb
2728
- uses: MatteoH2O1999/setup-python@v2
2829
with:
2930
python-version: '2.7'
@@ -33,5 +34,8 @@ jobs:
3334
with:
3435
node-version: ${{ matrix.version }}
3536
- run: npm install --production
36-
- run: node ${{ matrix.flags }} par-compare.js -f -v
37+
env:
38+
CFLAGS: -ggdb
39+
CXXFLAGS: -ggdb
40+
- run: node ${{ matrix.flags }} par-compare.js -f -v -d
3741
working-directory: test

test/par-compare.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
var tmpDir = (process.env.TMP || process.env.TEMP || '.') + require('path').sep;
1010
//var tmpDir = require('path').resolve('./tmp') + require('path').sep;
1111
var exeNode = 'node';
12+
var exeGdb = 'gdb'; // only used if native stack traces wanted
1213
var exeParpar = '../bin/parpar';
1314
var exePar2 = 'par2';
1415

@@ -19,6 +20,7 @@ var pruneCache = false; // prune unused keys from cached results
1920
var procArgs = process.argv.slice(2);
2021
var fastTest = procArgs.indexOf('-f') > -1;
2122
var verbose = procArgs.indexOf('-v') > -1;
23+
var use_gdb = procArgs.indexOf('-d') > -1;
2224

2325
var fs = require('fs');
2426
var crypto = require('crypto');
@@ -579,14 +581,18 @@ async.timesSeries(allTests.length, function(testNum, cb) {
579581
var testFiles, refFiles;
580582
var execArgs = exeParpar ? (Array.isArray(exeParpar) ? exeParpar : [exeParpar]).concat(testArgs) : testArgs;
581583
console.log('Executing: ' + exeNode, execArgs.map(function(arg) { return '"' + arg + '"'; }).join(' ')); // arguments not properly escaped, but should be good enough for 99% of cases
584+
if(use_gdb) {
585+
execArgs = ['--batch', '-ex','r', '-ex','bt', '-ex','q $_exitcode', '--args', exeNode].concat(execArgs);
586+
}
582587
var timePP, timeP2;
583588
timePP = Date.now();
584-
proc.execFile(exeNode, execArgs, function(err, stdout, stderr) {
589+
proc.execFile(use_gdb ? exeGdb : exeNode, execArgs, function(err, stdout, stderr) {
585590
timePP = Date.now() - timePP;
586591
if(err) {
587592
console.error('Error occurred after ' + (timePP/1000) + '; std output: ');
588593
process.stdout.write(stdout);
589594
process.stderr.write(stderr);
595+
console.log('Error object: ', err);
590596
throw err;
591597
}
592598

0 commit comments

Comments
 (0)