Repository navigation
Expand file tree
/
Copy path.travis.yml
More file actions
executable file
·90 lines (76 loc) · 4.86 KB
/
Copy path.travis.yml
File metadata and controls
executable file
·90 lines (76 loc) · 4.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
language: node_js
node_js: 12 # Note: windows requires 10 or higher
dist: xenial # Note: dist>=xenial required by microk8s
cache: false # as of 20190709 trav-ci.org started loading garbage from the build cache
services:
- docker
env:
global:
- NYC=true # we want code coverage stats
- WEBPACK_CLIENT_URL="http://localhost:9080/"
- RUNNING_KUI_TEST=true
- KUI_USE_HTTP=true
- CSP_ALLOWED_HOSTS="http://localhost:8081 ws://localhost:8081 http://localhost:9953 ws://localhost:9080 http://localhost:9080 ws://localhost:9081 http://localhost:9081 ws://localhost:9082 http://localhost:9082 ws://localhost:9084 http://localhost:9084"
- PATH=bin:$PATH
- WINDOW_WIDTH=1400 # ! important ! so that clicks don't fail due to elements being off-viewport
- WINDOW_HEIGHT=1050 # ! ibid !
- BUILD_ENV=production # used in dist/electron/build.sh with npm prune --production
- MOCHA_RUN_TARGET=electron # to save some verbosity below, use this as the default; it will be adjusted to "webpack" as needed
- NO_OPT=true # we don't need any webpack bundle optimizations while running tests
- NO_INSTALLER=true # we don't need to bother building electron package tarballs or DMGs
before_script:
- export DISPLAY=:1; Xvfb $DISPLAY -screen 0 ${WINDOW_WIDTH}x${WINDOW_HEIGHT}x24 $DISPLAY -ac > /dev/null &
- export DISPLAY=:2; Xvfb $DISPLAY -screen 0 ${WINDOW_WIDTH}x${WINDOW_HEIGHT}x24 $DISPLAY -ac > /dev/null &
- export DISPLAY=:3; Xvfb $DISPLAY -screen 0 ${WINDOW_WIDTH}x${WINDOW_HEIGHT}x24 $DISPLAY -ac > /dev/null &
- export DISPLAY=:4; Xvfb $DISPLAY -screen 0 ${WINDOW_WIDTH}x${WINDOW_HEIGHT}x24 $DISPLAY -ac > /dev/null &
- npm install -g concurrently
- ${TRAVIS_BUILD_DIR}/tools/travis/cleanupNvm.sh
# upload codecov
after_script: if [ -n "$NYC" ]; then cd "${TRAVIS_BUILD_DIR}" && ./tools/codecov/report.sh; fi
# default install script
install:
- npm ci
- ./tools/codecov/instrument.sh
- if [ "$MOCHA_RUN_TARGET" = "webpack" ]; then (npm run proxy &) && (cd clients/$CLIENT && npm install && npm run watch:webpack); else (cd clients/$CLIENT && npm install && npm run build:electron -- $TRAVIS_OS_NAME); fi
stages:
- test
jobs:
allow_failures:
- if: os = windows AND env(NO_WINDOWS) IS present
include:
# API Tests | os=Linux | targets=webpack-watch
- env: N="API" CLIENT="test" WEBPACK_CLIENT_URL="" # test:parallel formulates its own WP_CLIENT_URL
install:
- npm ci && ./tools/codecov/instrument.sh
- TEST_ROOT=packages/test TEST_SUITE_ROOT=node_modules/@kui-shell NYC_INSTRUMENTATION_DONE=true npm run compile # codecov of prescan
- cd clients/$CLIENT && npm install
script: npm run test:webpack
# API Tests | os=Linux | targets=electron-watch
- env: N="API" CLIENT="test" WEBPACK_CLIENT_URL="" # test:parallel formulates its own WP_CLIENT_URL
install:
- npm ci && ./tools/codecov/instrument.sh
- cd clients/$CLIENT && npm install
script: npm run test:electron
# Core Tests | os=Darwin | targets=electron-build
- os: osx
env: N="Mac core" CLIENT="default" TEST_FROM_BUILD=`[ "$TRAVIS_OS_NAME" = linux ] && echo "${TRAVIS_BUILD_DIR}/clients/$CLIENT/dist/electron/Kui-linux-x64/Kui" || echo "${TRAVIS_BUILD_DIR}/clients/$CLIENT/dist/electron/Kui-darwin-x64/Kui.app/Contents/MacOS/Kui"` HOMEBREW_NO_AUTO_UPDATE=1
before_install: which jq || brew install jq
script: concurrently -n CORE,SUP1,EDIT,SUP2 'npm run test1 core' 'npm run test2 core-support' 'npm run test3 editor' 'npm run test4 core-support2'
# bottom-input Tests | os=Linux | targets=webpack-watch
- env: N="bottom-input" CLIENT="alternate" WEBPACK_CLIENT_URL="" # test:parallel formulates its own WP_CLIENT_URL
install:
- npm ci && ./tools/codecov/instrument.sh
- cd clients/$CLIENT && npm install
script: npm run test:webpack
# - env: N="Linux core" LAYERS="core core-support editor"
# Core Tests | os=Linux | targets=webpack-watch
- env: N="Webpack core" CLIENT="default" MOCHA_RUN_TARGET="webpack" KUI_USE_PROXY="true"
script: concurrently -n CORE,SUP1,EDIT,SUP2 'npm run test1 core' 'npm run test2 core-support' 'npm run test3 editor' 'npm run test4 core-support2'
# Bash Tests | os=Linux | targets=electron-build
- env: N="Linux bash" CLIENT="default" TEST_FROM_BUILD="${TRAVIS_BUILD_DIR}/clients/$CLIENT/dist/electron/Kui-linux-x64/Kui"
before_install: ./tools/travis/ibmcloud.sh # see plugins/plugin-bash-like/src/test/bash-like/bash-like.ts
script: npm run test1 bash-like
# Bash Tests | os=Linux | targets=webpack-watch
- env: N="Webpack bash" CLIENT="default" MOCHA_RUN_TARGET="webpack" KUI_USE_PROXY="true"
before_install: ./tools/travis/ibmcloud.sh # see plugins/plugin-bash-like/src/test/bash-like/bash-like.ts
script: npm run test1 bash-like-wait && npm run test1 bash-like