Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #164 from github/npm_test_os
Run `npm test` on linux and macos
Robert authored and GitHub committed Aug 28, 2020

Unverified

No user is associated with the committer email.
2 parents 8229390 + b1d719e commit 5bd2832
Showing 4 changed files with 29 additions and 13 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pr-checks.yml
@@ -65,9 +65,12 @@ jobs:
echo "Success: node_modules are up to date"
npm-test:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest,macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v1
- name: npm run-script test
run: npm run-script test
run: npm run-script test
16 changes: 11 additions & 5 deletions lib/tracer-config.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/tracer-config.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions src/tracer-config.test.ts
@@ -299,13 +299,20 @@ test('getCombinedTracerConfig - valid spec file', async t => {
});

const result = await getCombinedTracerConfig(config, codeQL);

const expectedEnv = {
'foo': 'bar',
'ODASA_TRACER_CONFIGURATION': result!.spec,
};
if (process.platform === 'darwin') {
expectedEnv['DYLD_INSERT_LIBRARIES'] = path.join(path.dirname(codeQL.getPath()), 'tools', 'osx64', 'libtrace.dylib');
} else if (process.platform !== 'win32') {
expectedEnv['LD_PRELOAD'] = path.join(path.dirname(codeQL.getPath()), 'tools', 'linux64', '${LIB}trace.so');
}

t.deepEqual(result, {
spec: path.join(tmpDir, 'compound-spec'),
env: {
'foo': 'bar',
'ODASA_TRACER_CONFIGURATION': result!.spec,
'LD_PRELOAD': path.join(path.dirname(codeQL.getPath()), 'tools', 'linux64', '${LIB}trace.so'),
}
env: expectedEnv,
});
});
});

0 comments on commit 5bd2832

Please sign in to comment.