Skip to content

Commit 48d67fb

Browse files
committed
test
1 parent bf16ec3 commit 48d67fb

File tree

1 file changed

+123
-51
lines changed

1 file changed

+123
-51
lines changed

.github/workflows/main.yml

Lines changed: 123 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,48 @@ 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: [ "all" ]
45+
exclude:
46+
- auth: "true"
47+
cassandra_version: '4.1.6'
4248
steps:
4349
- uses: actions/checkout@v2
4450
- uses: actions/setup-go@v2
@@ -115,31 +121,11 @@ jobs:
115121
if: 'failure()'
116122
uses: actions/upload-artifact@v4
117123
with:
118-
name: ccm-cluster-cassandra-${{ matrix.cassandra_version }}-go-${{ matrix.go }}-tag-${{ matrix.tags }}
124+
name: ccm-cluster-cassandra-${{ matrix.cassandra_version }}-go-${{ matrix.go }}-tag-${{ matrix.tags }}-auth-${{ matrix.auth}}
119125
path: /home/runner/.ccm/test
120126
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
127+
- name: Start cassandra nodes for auth if needed
128+
if: ${{ matrix.auth == 'true' }}
143129
run: |
144130
source ~/venv/bin/activate
145131
VERSION=${{ matrix.cassandra_version }}
@@ -159,7 +145,7 @@ jobs:
159145
"authorizer: CassandraAuthorizer"
160146
"enable_user_defined_functions: true"
161147
)
162-
148+
163149
if [[ $VERSION == 3.*.* ]]; then
164150
conf+=(
165151
"rpc_server_type: sync"
@@ -179,27 +165,113 @@ jobs:
179165
"materialized_views_enabled: true"
180166
)
181167
fi
182-
168+
183169
ccm remove test || true
184-
170+
185171
ccm create test -v $VERSION -n 1 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
186172
ccm updateconf "${conf[@]}"
187-
173+
188174
rm -rf $HOME/.ccm/test/node1/data/system_auth
189-
175+
190176
export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
191-
177+
192178
ccm start --wait-for-binary-proto --verbose
193179
ccm status
194180
ccm node1 nodetool status
195-
181+
196182
args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=1 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
197-
183+
198184
echo "args=$args" >> $GITHUB_ENV
199185
echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
200186
sleep 30s
201187
- name: Integration tests
188+
if: ${{ matrix.auth == 'true' }}
202189
run: |
203190
source ~/venv/bin/activate
204191
export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
205192
go test -v -run=TestAuthentication -tags "${{ matrix.tags }} gocql_debug" -timeout=15s -runauth ${{ env.args }}
193+
# integration-auth-cassandra:
194+
# timeout-minutes: 15
195+
## needs:
196+
## - build
197+
# name: Integration Tests with auth
198+
# runs-on: ubuntu-latest
199+
# strategy:
200+
# fail-fast: false
201+
# matrix:
202+
# go: [ '1.22', '1.23' ]
203+
# cassandra_version: [ '4.0.13' ]
204+
# compressor: [ "snappy" ]
205+
# tags: [ "integration" ]
206+
#
207+
# steps:
208+
# - uses: actions/checkout@v3
209+
# - uses: actions/setup-go@v4
210+
# with:
211+
# go-version: ${{ matrix.go }}
212+
# - name: Setup environment
213+
# uses: ./.github/actions/setup-environment
214+
# - name: Start cassandra nodes
215+
# run: |
216+
# source ~/venv/bin/activate
217+
# VERSION=${{ matrix.cassandra_version }}
218+
# keypath="$(pwd)/testdata/pki"
219+
# conf=(
220+
# "client_encryption_options.enabled: true"
221+
# "client_encryption_options.keystore: $keypath/.keystore"
222+
# "client_encryption_options.keystore_password: cassandra"
223+
# "client_encryption_options.require_client_auth: true"
224+
# "client_encryption_options.truststore: $keypath/.truststore"
225+
# "client_encryption_options.truststore_password: cassandra"
226+
# "concurrent_reads: 2"
227+
# "concurrent_writes: 2"
228+
# "write_request_timeout_in_ms: 5000"
229+
# "read_request_timeout_in_ms: 5000"
230+
# "authenticator: PasswordAuthenticator"
231+
# "authorizer: CassandraAuthorizer"
232+
# "enable_user_defined_functions: true"
233+
# )
234+
#
235+
# if [[ $VERSION == 3.*.* ]]; then
236+
# conf+=(
237+
# "rpc_server_type: sync"
238+
# "rpc_min_threads: 2"
239+
# "rpc_max_threads: 2"
240+
# "enable_user_defined_functions: true"
241+
# "enable_materialized_views: true"
242+
# )
243+
# elif [[ $VERSION == 4.0.* ]]; then
244+
# conf+=(
245+
# "enable_user_defined_functions: true"
246+
# "enable_materialized_views: true"
247+
# )
248+
# else
249+
# conf+=(
250+
# "user_defined_functions_enabled: true"
251+
# "materialized_views_enabled: true"
252+
# )
253+
# fi
254+
#
255+
# ccm remove test || true
256+
#
257+
# ccm create test -v $VERSION -n 1 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
258+
# ccm updateconf "${conf[@]}"
259+
#
260+
# rm -rf $HOME/.ccm/test/node1/data/system_auth
261+
#
262+
# export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
263+
#
264+
# ccm start --wait-for-binary-proto --verbose
265+
# ccm status
266+
# ccm node1 nodetool status
267+
#
268+
# args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=1 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
269+
#
270+
# echo "args=$args" >> $GITHUB_ENV
271+
# echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
272+
# sleep 30s
273+
# - name: Integration tests
274+
# run: |
275+
# source ~/venv/bin/activate
276+
# export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
277+
# go test -v -run=TestAuthentication -tags "${{ matrix.tags }} gocql_debug" -timeout=15s -runauth ${{ env.args }}

0 commit comments

Comments
 (0)