Skip to content

Commit 4255b94

Browse files
committed
test
1 parent bf16ec3 commit 4255b94

File tree

1 file changed

+125
-51
lines changed

1 file changed

+125
-51
lines changed

.github/workflows/main.yml

Lines changed: 125 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,50 @@ name: Build
33
on:
44
push:
55
branches:
6-
- master
6+
# - master
7+
- ci-integration-tests-simplify
78
pull_request:
89
types: [ opened, synchronize, reopened ]
910

1011
env:
1112
CCM_VERSION: "6e71061146f7ae67b84ccd2b1d90d7319b640e4c"
1213

1314
jobs:
14-
build:
15-
name: Unit tests
16-
runs-on: ubuntu-latest
17-
strategy:
18-
matrix:
19-
go: [ '1.22', '1.23' ]
20-
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-go@v4
23-
with:
24-
go-version: ${{ matrix.go }}
25-
- run: go vet
26-
- name: Run unit tests
27-
run: go test -v -tags unit -race
15+
# build:
16+
# name: Unit tests
17+
# runs-on: ubuntu-latest
18+
# strategy:
19+
# matrix:
20+
# go: [ '1.22', '1.23' ]
21+
# steps:
22+
# - uses: actions/checkout@v3
23+
# - uses: actions/setup-go@v4
24+
# with:
25+
# go-version: ${{ matrix.go }}
26+
# - run: go vet
27+
# - name: Run unit tests
28+
# run: go test -v -tags unit -race
2829
integration-cassandra:
2930
timeout-minutes: 15
30-
needs:
31-
- build
31+
# needs:
32+
# - build
3233
name: Integration Tests
3334
runs-on: ubuntu-latest
3435
strategy:
3536
fail-fast: false
3637
matrix:
37-
go: [ '1.22', '1.23' ]
38+
# go: [ '1.22', '1.23' ]
39+
go: [ '1.22' ]
3840
cassandra_version: [ '4.0.13', '4.1.6' ]
39-
auth: [ "false" ]
41+
auth: [ "false", "true" ]
4042
compressor: [ "snappy" ]
41-
tags: [ "cassandra", "integration", "ccm" ]
43+
# tags: [ "cassandra", "integration", "ccm" ]
44+
tags: [ "cassandra integration ccm", "integration" ]
45+
exclude:
46+
- auth: "true"
47+
cassandra_version: '4.1.6'
48+
- auth: "true"
49+
tags: "cassandra integration ccm"
4250
steps:
4351
- uses: actions/checkout@v2
4452
- uses: actions/setup-go@v2
@@ -115,31 +123,11 @@ jobs:
115123
if: 'failure()'
116124
uses: actions/upload-artifact@v4
117125
with:
118-
name: ccm-cluster-cassandra-${{ matrix.cassandra_version }}-go-${{ matrix.go }}-tag-${{ matrix.tags }}
126+
name: ccm-cluster-cassandra-${{ matrix.cassandra_version }}-go-${{ matrix.go }}-tag-${{ matrix.tags }}-auth-${{ matrix.auth}}
119127
path: /home/runner/.ccm/test
120128
retention-days: 5
121-
integration-auth-cassandra:
122-
timeout-minutes: 15
123-
needs:
124-
- build
125-
name: Integration Tests with auth
126-
runs-on: ubuntu-latest
127-
strategy:
128-
fail-fast: false
129-
matrix:
130-
go: [ '1.22', '1.23' ]
131-
cassandra_version: [ '4.0.13' ]
132-
compressor: [ "snappy" ]
133-
tags: [ "integration" ]
134-
135-
steps:
136-
- uses: actions/checkout@v3
137-
- uses: actions/setup-go@v4
138-
with:
139-
go-version: ${{ matrix.go }}
140-
- name: Setup environment
141-
uses: ./.github/actions/setup-environment
142-
- name: Start cassandra nodes
129+
- name: Start cassandra nodes for auth if needed
130+
if: ${{ matrix.auth == 'true' }}
143131
run: |
144132
source ~/venv/bin/activate
145133
VERSION=${{ matrix.cassandra_version }}
@@ -159,7 +147,7 @@ jobs:
159147
"authorizer: CassandraAuthorizer"
160148
"enable_user_defined_functions: true"
161149
)
162-
150+
163151
if [[ $VERSION == 3.*.* ]]; then
164152
conf+=(
165153
"rpc_server_type: sync"
@@ -179,27 +167,113 @@ jobs:
179167
"materialized_views_enabled: true"
180168
)
181169
fi
182-
170+
183171
ccm remove test || true
184-
172+
185173
ccm create test -v $VERSION -n 1 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
186174
ccm updateconf "${conf[@]}"
187-
175+
188176
rm -rf $HOME/.ccm/test/node1/data/system_auth
189-
177+
190178
export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
191-
179+
192180
ccm start --wait-for-binary-proto --verbose
193181
ccm status
194182
ccm node1 nodetool status
195-
183+
196184
args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=1 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
197-
185+
198186
echo "args=$args" >> $GITHUB_ENV
199187
echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
200188
sleep 30s
201189
- name: Integration tests
190+
if: ${{ matrix.auth == 'true' }}
202191
run: |
203192
source ~/venv/bin/activate
204193
export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
205194
go test -v -run=TestAuthentication -tags "${{ matrix.tags }} gocql_debug" -timeout=15s -runauth ${{ env.args }}
195+
# integration-auth-cassandra:
196+
# timeout-minutes: 15
197+
## needs:
198+
## - build
199+
# name: Integration Tests with auth
200+
# runs-on: ubuntu-latest
201+
# strategy:
202+
# fail-fast: false
203+
# matrix:
204+
# go: [ '1.22', '1.23' ]
205+
# cassandra_version: [ '4.0.13' ]
206+
# compressor: [ "snappy" ]
207+
# tags: [ "integration" ]
208+
#
209+
# steps:
210+
# - uses: actions/checkout@v3
211+
# - uses: actions/setup-go@v4
212+
# with:
213+
# go-version: ${{ matrix.go }}
214+
# - name: Setup environment
215+
# uses: ./.github/actions/setup-environment
216+
# - name: Start cassandra nodes
217+
# run: |
218+
# source ~/venv/bin/activate
219+
# VERSION=${{ matrix.cassandra_version }}
220+
# keypath="$(pwd)/testdata/pki"
221+
# conf=(
222+
# "client_encryption_options.enabled: true"
223+
# "client_encryption_options.keystore: $keypath/.keystore"
224+
# "client_encryption_options.keystore_password: cassandra"
225+
# "client_encryption_options.require_client_auth: true"
226+
# "client_encryption_options.truststore: $keypath/.truststore"
227+
# "client_encryption_options.truststore_password: cassandra"
228+
# "concurrent_reads: 2"
229+
# "concurrent_writes: 2"
230+
# "write_request_timeout_in_ms: 5000"
231+
# "read_request_timeout_in_ms: 5000"
232+
# "authenticator: PasswordAuthenticator"
233+
# "authorizer: CassandraAuthorizer"
234+
# "enable_user_defined_functions: true"
235+
# )
236+
#
237+
# if [[ $VERSION == 3.*.* ]]; then
238+
# conf+=(
239+
# "rpc_server_type: sync"
240+
# "rpc_min_threads: 2"
241+
# "rpc_max_threads: 2"
242+
# "enable_user_defined_functions: true"
243+
# "enable_materialized_views: true"
244+
# )
245+
# elif [[ $VERSION == 4.0.* ]]; then
246+
# conf+=(
247+
# "enable_user_defined_functions: true"
248+
# "enable_materialized_views: true"
249+
# )
250+
# else
251+
# conf+=(
252+
# "user_defined_functions_enabled: true"
253+
# "materialized_views_enabled: true"
254+
# )
255+
# fi
256+
#
257+
# ccm remove test || true
258+
#
259+
# ccm create test -v $VERSION -n 1 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
260+
# ccm updateconf "${conf[@]}"
261+
#
262+
# rm -rf $HOME/.ccm/test/node1/data/system_auth
263+
#
264+
# export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
265+
#
266+
# ccm start --wait-for-binary-proto --verbose
267+
# ccm status
268+
# ccm node1 nodetool status
269+
#
270+
# args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=1 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
271+
#
272+
# echo "args=$args" >> $GITHUB_ENV
273+
# echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
274+
# sleep 30s
275+
# - name: Integration tests
276+
# run: |
277+
# source ~/venv/bin/activate
278+
# export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
279+
# go test -v -run=TestAuthentication -tags "${{ matrix.tags }} gocql_debug" -timeout=15s -runauth ${{ env.args }}

0 commit comments

Comments
 (0)