jsunit: Run jsunit with chromium/puppeteer on github actions

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-12-29 08:18:29 +01:00
parent 14306222df
commit c7a320d880
5 changed files with 1065 additions and 2249 deletions

View File

@ -1,27 +1,4 @@
kind: pipeline kind: pipeline
name: jsunit
steps:
- name: jsunit
image: nextcloudci/jsunit:jsunit-5
environment:
CODECOV_TOKEN:
from_secret: CODECOV_TOKEN
commands:
- ./autotest-js.sh
- curl -o codecov.sh https://codecov.io/bash
- bash codecov.sh -C $DRONE_COMMIT
trigger:
branch:
- master
- stable*
event:
- pull_request
- push
---
kind: pipeline
name: checkers name: checkers
steps: steps:

View File

@ -49,6 +49,17 @@ jobs:
- name: Test - name: Test
run: npm run test run: npm run test
jsunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Test
run: ./autotest-js.sh
handlebars: handlebars:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:

3246
build/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -9,21 +9,20 @@
"private": true, "private": true,
"homepage": "https://github.com/nextcloud/", "homepage": "https://github.com/nextcloud/",
"contributors": [], "contributors": [],
"dependencies": {},
"devDependencies": { "devDependencies": {
"handlebars": "^4.7.6", "handlebars": "^4.7.6",
"jasmine-core": "~2.5.2", "jasmine-core": "~2.5.2",
"jasmine-sinon": "^0.4.0", "jasmine-sinon": "^0.4.0",
"jsdoc": "^3.6.6", "jsdoc": "^3.6.6",
"karma": "^3.1.4", "karma": "^5.2.3",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "2.0.1", "karma-coverage": "2.0.1",
"karma-jasmine": "^1.1.2", "karma-jasmine": "^1.1.2",
"karma-jasmine-sinon": "^1.0.4", "karma-jasmine-sinon": "^1.0.4",
"karma-junit-reporter": "^1.2.0", "karma-spec-reporter": "^0.0.32",
"karma-phantomjs-launcher": "^1.0.4",
"karma-viewport": "^1.0.7", "karma-viewport": "^1.0.7",
"node-sass": "~4.14.1", "node-sass": "~4.14.1",
"phantomjs-prebuilt": "*", "puppeteer": "^5.5.0",
"sinon": "<= 5.0.7" "sinon": "<= 5.0.7"
}, },
"engine": "node >= 6.9" "engine": "node >= 6.9"

View File

@ -33,6 +33,10 @@
* preprocessor, which is needed to be able to debug tests properly in a browser. * preprocessor, which is needed to be able to debug tests properly in a browser.
*/ */
if (!process.env.CHROMIUM_BIN) {
process.env.CHROMIUM_BIN = require('puppeteer').executablePath()
}
/* jshint node: true */ /* jshint node: true */
module.exports = function(config) { module.exports = function(config) {
function findApps() { function findApps() {
@ -242,7 +246,16 @@ module.exports = function(config) {
// test results reporter to use // test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['dots', 'junit', 'coverage'], reporters: ['spec'],
specReporter: {
maxLogLines: 5,
suppressErrorSummary: false,
suppressFailed: false,
suppressPassed: true,
suppressSkipped: true,
showSpecTiming: false,
},
junitReporter: { junitReporter: {
outputFile: 'tests/autotest-results-js.xml' outputFile: 'tests/autotest-results-js.xml'
@ -281,16 +294,8 @@ module.exports = function(config) {
// - PhantomJS // - PhantomJS
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
// use PhantomJS_debug for extra local debug // use PhantomJS_debug for extra local debug
browsers: ['PhantomJS'], browsers: ['ChromiumHeadless'],
plugins: [
'karma-phantomjs-launcher',
'karma-coverage',
'karma-jasmine',
'karma-jasmine-sinon',
'karma-viewport',
'karma-junit-reporter'
],
// you can define custom flags // you can define custom flags
customLaunchers: { customLaunchers: {
PhantomJS_debug: { PhantomJS_debug: {