This repository has been archived by the owner on Apr 5, 2022. It is now read-only.
forked from influxdata/chronograf
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (72 loc) · 3.05 KB
/
chronograf-cypress-tests.yaml
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
name: "chronograf/cypress"
on:
workflow_dispatch:
push:
branches:
- 'test-cypress'
- 'master'
- 'qa-cypress'
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.16.4'
- name: Setup Helm
uses: azure/setup-helm@v1
with:
version: v3.6.3
- name: Create kind cluster
uses: helm/[email protected]
with:
cluster_name: "chronograf-testing"
config: .github/workflows/resources/kind-config.yaml
- name: Create Enterprise Test Resources
run: |
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.5.4/cert-manager.yaml
sleep 30 # wait for CertManager
kubectl apply -f .github/workflows/resources/test-reources.yaml
kubectl create secret generic influxdb-license --from-literal=INFLUXDB_ENTERPRISE_LICENSE_KEY=${INFLUXDB_ENTERPRISE_LICENSE_KEY}
helm repo add influxdata https://helm.influxdata.com/
helm upgrade --install influxdb influxdata/influxdb-enterprise --namespace default --set-string envFromSecret=influxdb-license --set-string data.service.type=NodePort
kubectl patch svc influxdb-influxdb-enterprise-data --type=json -p '[{"op":"replace","path":"/spec/ports/0/nodePort","value":30086}]'
kubectl get configmap/influxdb-influxdb-enterprise-data -o yaml > influxdb-influxdb-enterprise-data-patch
sed -in 's|\[http\]|[http]\\nflux-enabled = true|' influxdb-influxdb-enterprise-data-patch
kubectl patch configmap influxdb-influxdb-enterprise-data --patch-file influxdb-influxdb-enterprise-data-patch
kubectl exec influxdb-influxdb-enterprise-data-0 -c influxdb-enterprise /sbin/killall5
env:
INFLUXDB_ENTERPRISE_LICENSE_KEY: "${{ secrets.INFLUXDB_ENTERPRISE_LICENSE_KEY }}"
- name: Chronograf
run: |
npm install --global yarn
make
RUNNER_TRACKING_ID="" && (nohup ./chronograf > out.log 2>&1 &)
sleep 10
- name: Chronograf test url
run: |
echo "InfluxDB data node status: $(curl -Isk "https://localhost:8086/ping" | head -n 1)"
echo "Chronograf status: $(curl -Isk "http:https://localhost:8888" | head -n 1)"
cat out.log || exit 0
- name: Cypress
uses: addnab/docker-run-action@v3
with:
image: cypress/included:8.7.0
options: -i -v ${{ github.workspace }}/ui:/ui -w /ui --add-host=host.docker.internal:host-gateway
shell: sh
run: |
yarn install
npx browserslist@latest --update-db
cypress run --browser chrome --config baseUrl=http:https://host.docker.internal:8888
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: logs
path: ui/*.log
retention-days: 5