Skip to content

Commit 229cd7f

Browse files
committed
wip
1 parent bf16ec3 commit 229cd7f

File tree

1 file changed

+187
-112
lines changed

1 file changed

+187
-112
lines changed

.github/workflows/main.yml

Lines changed: 187 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -3,132 +3,207 @@ 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
28-
integration-cassandra:
29-
timeout-minutes: 15
30-
needs:
31-
- build
32-
name: Integration Tests
33-
runs-on: ubuntu-latest
34-
strategy:
35-
fail-fast: false
36-
matrix:
37-
go: [ '1.22', '1.23' ]
38-
cassandra_version: [ '4.0.13', '4.1.6' ]
39-
auth: [ "false" ]
40-
compressor: [ "snappy" ]
41-
tags: [ "cassandra", "integration", "ccm" ]
42-
steps:
43-
- uses: actions/checkout@v2
44-
- uses: actions/setup-go@v2
45-
with:
46-
go-version: ${{ matrix.go }}
47-
- uses: actions/cache@v4
48-
id: gomod-cache
49-
with:
50-
path: ~/go/pkg/mod
51-
key: ${{ runner.os }}-go-${{ hashFiles('go.mod') }}
52-
restore-keys: |
53-
${{ runner.os }}-go-
54-
- name: Setup environment
55-
uses: ./.github/actions/setup-environment
56-
- name: Start cassandra nodes
57-
run: |
58-
source ~/venv/bin/activate
59-
VERSION=${{ matrix.cassandra_version }}
60-
keypath="$(pwd)/testdata/pki"
61-
conf=(
62-
"client_encryption_options.enabled: true"
63-
"client_encryption_options.keystore: $keypath/.keystore"
64-
"client_encryption_options.keystore_password: cassandra"
65-
"client_encryption_options.require_client_auth: true"
66-
"client_encryption_options.truststore: $keypath/.truststore"
67-
"client_encryption_options.truststore_password: cassandra"
68-
"concurrent_reads: 2"
69-
"concurrent_writes: 2"
70-
"write_request_timeout_in_ms: 5000"
71-
"read_request_timeout_in_ms: 5000"
72-
)
73-
74-
if [[ $VERSION == 3.*.* ]]; then
75-
conf+=(
76-
"rpc_server_type: sync"
77-
"rpc_min_threads: 2"
78-
"rpc_max_threads: 2"
79-
"enable_user_defined_functions: true"
80-
"enable_materialized_views: true"
81-
)
82-
elif [[ $VERSION == 4.0.* ]]; then
83-
conf+=(
84-
"enable_user_defined_functions: true"
85-
"enable_materialized_views: true"
86-
)
87-
else
88-
conf+=(
89-
"user_defined_functions_enabled: true"
90-
"materialized_views_enabled: true"
91-
)
92-
fi
93-
94-
ccm remove test || true
95-
96-
ccm create test -v $VERSION -n 3 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
97-
ccm updateconf "${conf[@]}"
98-
99-
export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
100-
101-
ccm start --wait-for-binary-proto --verbose
102-
ccm status
103-
ccm node1 nodetool status
104-
105-
args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=3 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
106-
107-
echo "args=$args" >> $GITHUB_ENV
108-
echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
109-
- name: Integration tests
110-
run: |
111-
source ~/venv/bin/activate
112-
export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
113-
go test -v -tags "${{ matrix.tags }} gocql_debug" -timeout=5m -race ${{ env.args }}
114-
- name: 'Save ccm logs'
115-
if: 'failure()'
116-
uses: actions/upload-artifact@v4
117-
with:
118-
name: ccm-cluster-cassandra-${{ matrix.cassandra_version }}-go-${{ matrix.go }}-tag-${{ matrix.tags }}
119-
path: /home/runner/.ccm/test
120-
retention-days: 5
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
29+
# integration-cassandra:
30+
# timeout-minutes: 15
31+
## needs:
32+
## - build
33+
# name: Integration Tests
34+
# runs-on: ubuntu-latest
35+
# strategy:
36+
# fail-fast: false
37+
# matrix:
38+
## go: [ '1.22', '1.23' ]
39+
# go: [ '1.22' ]
40+
## cassandra_version: [ '4.0.13', '4.1.6' ]
41+
# cassandra_version: [ '4.0.13']
42+
## auth: [ "false" ]
43+
# compressor: [ "snappy" ]
44+
## tags: [ "cassandra", "integration", "ccm" ]
45+
# tags: [ "all" ]
46+
# steps:
47+
# - uses: actions/checkout@v2
48+
# - uses: actions/setup-go@v2
49+
# with:
50+
# go-version: ${{ matrix.go }}
51+
# - uses: actions/cache@v4
52+
# id: gomod-cache
53+
# with:
54+
# path: ~/go/pkg/mod
55+
# key: ${{ runner.os }}-go-${{ hashFiles('go.mod') }}
56+
# restore-keys: |
57+
# ${{ runner.os }}-go-
58+
# - name: Setup environment
59+
# uses: ./.github/actions/setup-environment
60+
# - name: Start cassandra nodes
61+
# run: |
62+
# source ~/venv/bin/activate
63+
# VERSION=${{ matrix.cassandra_version }}
64+
# keypath="$(pwd)/testdata/pki"
65+
# conf=(
66+
# "client_encryption_options.enabled: true"
67+
# "client_encryption_options.keystore: $keypath/.keystore"
68+
# "client_encryption_options.keystore_password: cassandra"
69+
# "client_encryption_options.require_client_auth: true"
70+
# "client_encryption_options.truststore: $keypath/.truststore"
71+
# "client_encryption_options.truststore_password: cassandra"
72+
# "concurrent_reads: 2"
73+
# "concurrent_writes: 2"
74+
# "write_request_timeout_in_ms: 5000"
75+
# "read_request_timeout_in_ms: 5000"
76+
# )
77+
#
78+
# if [[ $VERSION == 3.*.* ]]; then
79+
# conf+=(
80+
# "rpc_server_type: sync"
81+
# "rpc_min_threads: 2"
82+
# "rpc_max_threads: 2"
83+
# "enable_user_defined_functions: true"
84+
# "enable_materialized_views: true"
85+
# )
86+
# elif [[ $VERSION == 4.0.* ]]; then
87+
# conf+=(
88+
# "enable_user_defined_functions: true"
89+
# "enable_materialized_views: true"
90+
# )
91+
# else
92+
# conf+=(
93+
# "user_defined_functions_enabled: true"
94+
# "materialized_views_enabled: true"
95+
# )
96+
# fi
97+
#
98+
# ccm remove test || true
99+
#
100+
# ccm create test -v $VERSION -n 3 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
101+
# ccm updateconf "${conf[@]}"
102+
#
103+
# export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
104+
#
105+
# ccm start --wait-for-binary-proto --verbose
106+
# ccm status
107+
# ccm node1 nodetool status
108+
#
109+
# args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=3 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
110+
#
111+
# echo "args=$args" >> $GITHUB_ENV
112+
# echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
113+
# - name: Integration tests
114+
# run: |
115+
# source ~/venv/bin/activate
116+
# export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
117+
## go test -v -tags "${{ matrix.tags }} gocql_debug" -timeout=5m -race ${{ env.args }}
118+
# - name: 'Save ccm logs'
119+
# if: 'failure()'
120+
# uses: actions/upload-artifact@v4
121+
# with:
122+
# name: ccm-cluster-cassandra-${{ matrix.cassandra_version }}-go-${{ matrix.go }}-tag-${{ matrix.tags }}
123+
# path: /home/runner/.ccm/test
124+
# retention-days: 5
125+
# - uses: actions/checkout@v3
126+
# - uses: actions/setup-go@v4
127+
# with:
128+
# go-version: ${{ matrix.go }}
129+
# - name: Setup environment
130+
# uses: ./.github/actions/setup-environment
131+
# - name: Start cassandra nodes
132+
# run: |
133+
# source ~/venv/bin/activate
134+
# VERSION=${{ matrix.cassandra_version }}
135+
# keypath="$(pwd)/testdata/pki"
136+
# conf=(
137+
# "client_encryption_options.enabled: true"
138+
# "client_encryption_options.keystore: $keypath/.keystore"
139+
# "client_encryption_options.keystore_password: cassandra"
140+
# "client_encryption_options.require_client_auth: true"
141+
# "client_encryption_options.truststore: $keypath/.truststore"
142+
# "client_encryption_options.truststore_password: cassandra"
143+
# "concurrent_reads: 2"
144+
# "concurrent_writes: 2"
145+
# "write_request_timeout_in_ms: 5000"
146+
# "read_request_timeout_in_ms: 5000"
147+
# "authenticator: PasswordAuthenticator"
148+
# "authorizer: CassandraAuthorizer"
149+
# "enable_user_defined_functions: true"
150+
# )
151+
#
152+
# if [[ $VERSION == 3.*.* ]]; then
153+
# conf+=(
154+
# "rpc_server_type: sync"
155+
# "rpc_min_threads: 2"
156+
# "rpc_max_threads: 2"
157+
# "enable_user_defined_functions: true"
158+
# "enable_materialized_views: true"
159+
# )
160+
# elif [[ $VERSION == 4.0.* ]]; then
161+
# conf+=(
162+
# "enable_user_defined_functions: true"
163+
# "enable_materialized_views: true"
164+
# )
165+
# else
166+
# conf+=(
167+
# "user_defined_functions_enabled: true"
168+
# "materialized_views_enabled: true"
169+
# )
170+
# fi
171+
#
172+
# ccm remove test || true
173+
#
174+
# ccm create test -v $VERSION -n 1 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
175+
# ccm updateconf "${conf[@]}"
176+
#
177+
# rm -rf $HOME/.ccm/test/node1/data/system_auth
178+
#
179+
# export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
180+
#
181+
# ccm start --wait-for-binary-proto --verbose
182+
# ccm status
183+
# ccm node1 nodetool status
184+
#
185+
# args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=1 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
186+
#
187+
# echo "args=$args" >> $GITHUB_ENV
188+
# echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
189+
# sleep 30s
190+
# - name: Integration tests
191+
# run: |
192+
# source ~/venv/bin/activate
193+
# export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
194+
# go test -v -run=TestAuthentication -tags "${{ matrix.tags }} gocql_debug" -timeout=15s -runauth ${{ env.args }}
121195
integration-auth-cassandra:
122196
timeout-minutes: 15
123-
needs:
124-
- build
197+
# needs:
198+
# - build
125199
name: Integration Tests with auth
126200
runs-on: ubuntu-latest
127201
strategy:
128202
fail-fast: false
129203
matrix:
130-
go: [ '1.22', '1.23' ]
131-
cassandra_version: [ '4.0.13' ]
204+
# go: [ '1.22', '1.23' ]
205+
go: [ '1.22' ]
206+
cassandra_version: [ '4.0.13', '4.1.6' ]
132207
compressor: [ "snappy" ]
133208
tags: [ "integration" ]
134209

0 commit comments

Comments
 (0)