forked from kubernetes-sigs/kui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
executable file
·86 lines (72 loc) · 5.08 KB
/
.travis.yml
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
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
- USE_WATCH_PANE=true
- IBMCLOUD_TRACE=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
- TRAVIS_KUBE_VERSION=1.15.7
- TRAVIS_HELM_VERSION=2.13.0
- TRAVIS_OC_VERISON=4.3.3
- 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 &
- ${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:
- if [ -n "$NEEDS_K8S" ]; then ./tools/travis/microk8s.sh & k8s=$!; fi
- npm ci
- if [ -n "$NEEDS_IBMCLOUD" ]; then ./tools/travis/ibmcloud.sh && ./tools/travis/ibmcloud-plugin-build-install.sh; fi
- ./bin/switch-client.sh ${CLIENT-default}
- ./tools/codecov/instrument.sh
- if [ "$MOCHA_RUN_TARGET" = "webpack" ]; then export KUI_USE_PROXY=true; if [ "$DEPLOY" = "cluster" ]; then npx kui-build-webpack && npx kui-build-docker-with-proxy && (kui-run-cproxy &); else npm run watch:webpack; fi; elif [ -z "$TEST_FROM_BUILD" ]; then npm run watch:electron; else npm run build:electron:$TRAVIS_OS_NAME; fi
- if [ -n "$k8s" ]; then wait $k8s; fi
script:
- if [ -n "$CODECOV_OF_PRESCAN" ]; then TEST_ROOT=packages/test TEST_SUITE_ROOT=node_modules/@kui-shell NYC_INSTRUMENTATION_DONE=true npm run compile; fi
- npm run testv2 $LAYERS
jobs:
allow_failures:
- if: os = windows AND env(NO_WINDOWS) IS present
include:
# not sure what this is: - env: DEPLOY="cluster" LAYERS="core" MOCHA_RUN_TARGET=webpack
- env: LAYERS="k8s k8s-popup helm" NEEDS_K8S=true NEEDS_HELM=true TEST_FROM_BUILD="${TRAVIS_BUILD_DIR}/dist/electron/Kui-linux-x64/Kui" KUI_DIST_PATH=${TEST_FROM_BUILD} NEEDS_IBMCLOUD=true
# kubectl
- env: LAYERS=logs MOCHA_RUN_TARGET=webpack NEEDS_K8S=true NEEDS_OC=true
- env: LAYERS=k8s1 MOCHA_RUN_TARGET=webpack NEEDS_K8S=true NEEDS_OC=true
- env: LAYERS=k8s2 MOCHA_RUN_TARGET=webpack NEEDS_K8S=true NEEDS_OC=true NEEDS_TOP=true
- env: N="API" CLIENT="test" MOCHA_RUN_TARGET="webpack" LAYERS="response" CODECOV_OF_PRESCAN=true
- env: N="API" CLIENT="test" MOCHA_RUN_TARGET="electron" LAYERS="response"
- env: N="bottom-input" CLIENT="alternate" MOCHA_RUN_TARGET="webpack" LAYERS="bottom-input" BOTTOM_INPUT_MODE=true
# CLIENT=default | os=Darwin | TARGET=electron | core, core-support, editor, core-support2
- os: osx
env: N="Mac core" CLIENT="default" TEST_FROM_BUILD=`[ "$TRAVIS_OS_NAME" = linux ] && echo "${TRAVIS_BUILD_DIR}/dist/electron/Kui-linux-x64/Kui" || echo "${TRAVIS_BUILD_DIR}/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'
# CLIENT=default | os=Linux | targets=webpack | core, core-support, editor, core-support2
- 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'
# CLIENT=default | os=Linux | targets=electron | bash-like
- env: N="Linux bash" CLIENT="default" TEST_FROM_BUILD="${TRAVIS_BUILD_DIR}/dist/electron/Kui-linux-x64/Kui"
script: npm run test1 bash-like
# CLIENT=default | os=Linux | targets=webpack | bash-like
- env: N="Webpack bash" CLIENT="default" MOCHA_RUN_TARGET="webpack" KUI_USE_PROXY="true"
script: npm run test1 bash-like-wait && npm run test1 bash-like