Skip to content

Commit

Permalink
Merge branch 'generator-karma-puppeteer'
Browse files Browse the repository at this point in the history
  • Loading branch information
tcuser committed Mar 19, 2021
2 parents 193341c + f843a54 commit 8476f6b
Show file tree
Hide file tree
Showing 4 changed files with 699 additions and 1,136 deletions.
15 changes: 9 additions & 6 deletions .teamcity/settings.kts
Expand Up @@ -241,7 +241,7 @@ object Deploy : BuildType({
npm run bootstrap
npm run build
""".trimIndent()
dockerImage = "huston007/node-electron:latest"
dockerImage = "node:latest"
dockerRunParameters = "-v %teamcity.build.workingDir%/npmlogs:/root/.npm/_logs"
}
}
Expand Down Expand Up @@ -639,7 +639,7 @@ object GeneratorE2eTest : BuildType({
}

params {
param("env.ELECTRON_ENABLE_LOGGING", "false")
param("env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD", "")
}

steps {
Expand All @@ -652,11 +652,15 @@ object GeneratorE2eTest : BuildType({
node -v
npm -v
useradd user -m
apt update
apt install g++ gcc make python -y
npm install
npm run bootstrap
su user -c "npm install && npm run bootstrap && npm run test-generator-e2e"
useradd user -m
su user -c "npm run test-generator-e2e"
""".trimIndent()
dockerImage = "huston007/node-electron"
dockerImage = "buildkite/puppeteer:5.2.1"
dockerRunParameters = "-v %teamcity.build.workingDir%/npmlogs:/root/.npm/_logs"
}
}
Expand Down Expand Up @@ -1320,7 +1324,6 @@ object UnitTestsAndBuild : BuildType({
param("env.GIT_COMMITTER_NAME", "")
param("env.GIT_AUTHOR_EMAIL", "")
param("npmjs.com.auth.key", "credentialsJSON:075c2e9e-0e12-4b18-9ec2-cb2f366d424e")
param("env.ELECTRON_ENABLE_LOGGING", "false")
}

vcs {
Expand Down
16 changes: 6 additions & 10 deletions packages/generator/app/templates/karma.conf.js
@@ -1,4 +1,6 @@
// Karma configuration
process.env.CHROME_BIN = require('puppeteer').executablePath();

const {entry, ...restWebpack} = require('./webpack.config.js')();

module.exports = config => {
Expand Down Expand Up @@ -72,18 +74,12 @@ module.exports = config => {

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['CustomElectron'],
browsers: [process.env.TEAMCITY_VERSION ? 'ChromeHeadlessNoSandbox' : 'ChromeHeadless'],

customLaunchers: {
CustomElectron: {
base: 'Electron',
browserWindowOptions: {
show: false,
skipTaskbar: true,
height: 1024,
width: 768
},
flags: ['--no-sandbox', '--disable-gpu', '--headless']
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--disable-setuid-sandbox']
}
},

Expand Down
7 changes: 3 additions & 4 deletions packages/generator/app/templates/package.json
Expand Up @@ -11,7 +11,7 @@
"test": "karma start",
"lint": "eslint . && npm run stylelint",
"stylelint": "stylelint --ignore-path .gitignore **/*.css",
"ci-test": "npm run lint && xvfb-maybe karma start",
"ci-test": "npm run lint && karma start",
"start": "webpack-dev-server -d --history-api-fallback --inline --hot --colors --port <%= port %>"
},
"babel": {
Expand Down Expand Up @@ -53,7 +53,6 @@
"chai-as-promised": "^7.1.1",
"chai-dom": "^1.9.0",
"chai-enzyme": "1.0.0-beta.1",
"electron": "^11.3.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"eslint": "^7.22.0",
Expand All @@ -64,18 +63,18 @@
"eslint-plugin-react-hooks": "^4.2.0",
"karma": "^6.2.0",
"karma-chai-plugins": "^0.9.0",
"karma-electron": "^6.3.3",
"karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^2.0.1",
"karma-sourcemap-loader": "^0.3.8",
"karma-teamcity-reporter": "^1.1.0",
"karma-webpack": "^5.0.0",
"mocha": "^8.3.2",
"puppeteer": "^8.0.0",
"react-test-renderer": "^17.0.1",
"sinon": "^9.2.4",
"sinon-chai": "^3.5.0",
"stylelint": "^13.12.0",
"svg-inline-loader": "^0.8.2",
"xvfb-maybe": "^0.2.1",
"yo": "^4.0.0-beta.0"
},
"engines": {
Expand Down

0 comments on commit 8476f6b

Please sign in to comment.