Skip to content

Commit

Permalink
UPGRADE frontend test to node 16, run on chrome
Browse files Browse the repository at this point in the history
The tests were running on PhantomJS, which hasn't been maintained for
years apparently. I tried to run the tests locally and it was erroring
out, though it was erroring with a different error than the error in
github actions. In either case, it would be a good idea to run out
PhantomJS as the cause, so I'm switching it to try to run on Chrome.

The 'puppeteer' package provides a headless Chromium which
can replace it. So I've switched the dependencies to run on headless
Chrome.

I've also updated the github action for the frontend test to the latest
setup-node and set it to run on the more current node 16.
  • Loading branch information
ionparticle committed May 9, 2022
1 parent 45bea77 commit 35bc71a
Show file tree
Hide file tree
Showing 4 changed files with 967 additions and 336 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ jobs:
unit_test_frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16
- name: Install dependencies
run: |
npm install
node_modules/gulp/bin/gulp.js
- name: Frontend Karma Tests
run: |
node_modules/karma/bin/karma start compair/static/test/config/karma.conf.js --single-run --browsers PhantomJS
node_modules/karma/bin/karma start compair/static/test/config/karma.conf.js --single-run
deploy_assets:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions compair/static/test/config/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
process.env.CHROME_BIN = require('puppeteer').executablePath()

module.exports = function (config) {
var wiredep = require('wiredep');
var bowerFiles = wiredep({devDependencies: true, cwd: __dirname + '/../../../..'})['js'];
Expand All @@ -20,11 +22,11 @@ module.exports = function (config) {

autoWatch: true,

browsers: ['Chrome'],
browsers: ['ChromeHeadless'],

junitReporter: {
outputFile: 'test_out/unit.xml',
suite: 'unit'
}
});
};
};
Loading

0 comments on commit 35bc71a

Please sign in to comment.