Skip to content

Commit

Permalink
Test GHA test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
animetosho committed Dec 13, 2024
1 parent f08027c commit eb23fb4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-dev-win64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ jobs:
- run: npm install --production --ignore-scripts
- run: npm install --production
working-directory: nexe
# diagnose weird execution failure
# workaround issue https://github.com/nodejs/node/issues/52681#issuecomment-2076426887
- run: |
(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"
(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"
working-directory: nexe
- run: node build
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
name: Test on Node v${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install -y gdb
- uses: MatteoH2O1999/setup-python@v2
with:
python-version: '2.7'
Expand All @@ -33,5 +34,8 @@ jobs:
with:
node-version: ${{ matrix.version }}
- run: npm install --production
- run: node ${{ matrix.flags }} par-compare.js -f -v
env:
CFLAGS: -ggdb
CXXFLAGS: -ggdb
- run: node ${{ matrix.flags }} par-compare.js -f -v -d
working-directory: test
8 changes: 7 additions & 1 deletion test/par-compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
var tmpDir = (process.env.TMP || process.env.TEMP || '.') + require('path').sep;
//var tmpDir = require('path').resolve('./tmp') + require('path').sep;
var exeNode = 'node';
var exeGdb = 'gdb'; // only used if native stack traces wanted
var exeParpar = '../bin/parpar';
var exePar2 = 'par2';

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

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

Expand Down

0 comments on commit eb23fb4

Please sign in to comment.