-
Notifications
You must be signed in to change notification settings - Fork 19
145 lines (145 loc) · 5.59 KB
/
tests.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: ZDM Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Runs a NoSQLBench job in docker-compose with 3 proxy nodes
# Verifies the written data matches in both ORIGIN and TARGET clusters
nosqlbench-tests:
name: NoSQLBench Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Start docker-compose
id: compose
run: |
docker compose -f docker-compose-tests.yml up --abort-on-container-exit --exit-code-from=nosqlbench
- name: Test Summary
if: ${{ failure() }}
run: |
docker container ls --all | grep zdm_tests_nb | awk '{print $1}' | xargs -I {} docker container cp {}:/logs reports
cat reports/*.summary >> $GITHUB_STEP_SUMMARY
# Runs all the unit tests under the proxy module (all the *_test.go files)
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run
run: |
sudo apt update
sudo apt -y install default-jre gcc git wget
wget https://go.dev/dl/go1.22.8.linux-amd64.tar.gz
sudo tar -xzf go*.tar.gz -C /usr/local/
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:`go env GOPATH`/bin
go install github.com/jstemmer/go-junit-report/v2@latest
go test -v 2>&1 ./proxy/... | go-junit-report -set-exit-code -iocopy -out report-unit.xml
- name: Test Summary
uses: test-summary/action@v1
if: always()
with:
paths: |
report-unit.xml
# Runs mock tests defined under integration-tests
# These tests use Simulacron and in-memory CQLServer
integration-tests-mock:
name: Mock Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run
run: |
sudo apt update
sudo apt -y install openjdk-8-jdk gcc git wget
wget https://go.dev/dl/go1.22.8.linux-amd64.tar.gz
sudo tar -xzf go*.tar.gz -C /usr/local/
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:`go env GOPATH`/bin
go install github.com/jstemmer/go-junit-report/v2@latest
wget https://github.com/datastax/simulacron/releases/download/0.10.0/simulacron-standalone-0.10.0.jar
export SIMULACRON_PATH=`pwd`/simulacron-standalone-0.10.0.jar
go test -timeout 180m -v 2>&1 ./integration-tests | go-junit-report -set-exit-code -iocopy -out report-integration-mock.xml
- name: Test Summary
uses: test-summary/action@v1
if: always()
with:
paths: |
report-integration-mock.xml
# Runs integration tests using CCM
integration-tests-ccm:
name: CCM Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run
run: |
sudo apt update
sudo apt -y install openjdk-8-jdk gcc git wget pip
wget https://go.dev/dl/go1.22.8.linux-amd64.tar.gz
sudo tar -xzf go*.tar.gz -C /usr/local/
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:`go env GOPATH`/bin
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
java -version
go install github.com/jstemmer/go-junit-report/v2@latest
pip install ccm
which ccm
sudo ln -s /home/runner/.local/bin/ccm /usr/local/bin/ccm
/usr/local/bin/ccm list
go test -timeout 180m -v 2>&1 ./integration-tests -RUN_MOCKTESTS=false -RUN_CCMTESTS=true | go-junit-report -set-exit-code -iocopy -out report-integration-ccm.xml
- name: Test Summary
uses: test-summary/action@v1
if: always()
with:
paths: |
report-integration-ccm.xml
# Runs the mock tests with go's race checker to spot potential data races
race-checker:
name: Race Checker
runs-on: ubuntu-latest
if: ${{ false }} # temporarily disabled
steps:
- uses: actions/checkout@v2
- name: Run
run: |
sudo apt update
sudo apt -y install openjdk-8-jdk gcc git pip wget
wget https://go.dev/dl/go1.22.8.linux-amd64.tar.gz
sudo tar -xzf go*.tar.gz -C /usr/local/
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:`go env GOPATH`/bin
go install github.com/jstemmer/go-junit-report/v2@latest
wget https://github.com/datastax/simulacron/releases/download/0.10.0/simulacron-standalone-0.10.0.jar
export SIMULACRON_PATH=`pwd`/simulacron-standalone-0.10.0.jar
go test -race -timeout 180m -v 2>&1 ./integration-tests | go-junit-report -set-exit-code -iocopy -out report-integration-race.xml
- name: Test Summary
uses: test-summary/action@v1
if: always()
with:
paths: |
report-integration-race.xml
# Performs static analysis to check for things like context leaks
go-vet:
name: Go Vet
runs-on: ubuntu-latest
if: ${{ false }} # temporarily disabled
steps:
- uses: actions/checkout@v2
- name: Run
run: |
sudo apt update
sudo apt -y install openjdk-8-jdk gcc git pip wget
wget https://go.dev/dl/go1.22.8.linux-amd64.tar.gz
sudo tar -xzf go*.tar.gz -C /usr/local/
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:`go env GOPATH`/bin
go vet ./...