77 pull_request :
88 types : [ opened, synchronize, reopened ]
99
10- env :
11- CCM_VERSION : " 6e71061146f7ae67b84ccd2b1d90d7319b640e4c"
12-
1310jobs :
1411 build :
1512 name : Unit tests
1613 runs-on : ubuntu-latest
1714 strategy :
1815 matrix :
19- go : [ '1.20' ]
16+ go : [ '1.20', '1.21' ]
2017 steps :
2118 - uses : actions/checkout@v3
2219 - uses : actions/setup-go@v4
@@ -25,195 +22,21 @@ jobs:
2522 - run : go vet
2623 - name : Run unit tests
2724 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.19', '1.20' ]
38- # cassandra_version: [ '4.0.8', '4.1.1' ]
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@v2
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: Install CCM
55- # run: pip install "git+https://github.com/riptano/ccm.git@${CCM_VERSION}"
56- # - name: Start cassandra nodes
57- # run: |
58- # VERSION=${{ matrix.cassandra_version }}
59- # keypath="$(pwd)/testdata/pki"
60- # conf=(
61- # "client_encryption_options.enabled: true"
62- # "client_encryption_options.keystore: $keypath/.keystore"
63- # "client_encryption_options.keystore_password: cassandra"
64- # "client_encryption_options.require_client_auth: true"
65- # "client_encryption_options.truststore: $keypath/.truststore"
66- # "client_encryption_options.truststore_password: cassandra"
67- # "concurrent_reads: 2"
68- # "concurrent_writes: 2"
69- # "write_request_timeout_in_ms: 5000"
70- # "read_request_timeout_in_ms: 5000"
71- # )
72- #
73- # if [[ $VERSION == 3.*.* ]]; then
74- # conf+=(
75- # "rpc_server_type: sync"
76- # "rpc_min_threads: 2"
77- # "rpc_max_threads: 2"
78- # "enable_user_defined_functions: true"
79- # "enable_materialized_views: true"
80- # )
81- # elif [[ $VERSION == 4.0.* ]]; then
82- # conf+=(
83- # "enable_user_defined_functions: true"
84- # "enable_materialized_views: true"
85- # )
86- # else
87- # conf+=(
88- # "user_defined_functions_enabled: true"
89- # "materialized_views_enabled: true"
90- # )
91- # fi
92- #
93- # ccm remove test || true
94- #
95- # ccm create test -v $VERSION -n 3 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
96- # ccm updateconf "${conf[@]}"
97- #
98- # export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
99- #
100- # ccm start --wait-for-binary-proto --verbose
101- # ccm status
102- # ccm node1 nodetool status
103- #
104- # args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=3 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
105- #
106- # echo "args=$args" >> $GITHUB_ENV
107- # echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
108- # - name: Integration tests
109- # run: |
110- # export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
111- # go test -v -tags "${{ matrix.tags }} gocql_debug" -timeout=5m -race ${{ env.args }}
112- # - name: 'Save ccm logs'
113- # if: 'failure()'
114- # uses: actions/upload-artifact@v3
115- # with:
116- # name: ccm-cluster
117- # path: /home/runner/.ccm/test
118- # retention-days: 5
119- # integration-auth-cassandra:
120- # timeout-minutes: 15
121- # needs:
122- # - build
123- # name: Integration Tests with auth
124- # runs-on: ubuntu-latest
125- # strategy:
126- # fail-fast: false
127- # matrix:
128- # go: [ '1.19', '1.20' ]
129- # cassandra_version: [ '4.0.8' ]
130- # compressor: [ "snappy" ]
131- # tags: [ "integration" ]
132- #
133- # steps:
134- # - uses: actions/checkout@v3
135- # - uses: actions/setup-go@v4
136- # with:
137- # go-version: ${{ matrix.go }}
138- # - name: Install CCM
139- # run: pip install "git+https://github.com/riptano/ccm.git@${CCM_VERSION}"
140- # - name: Start cassandra nodes
141- # run: |
142- # VERSION=${{ matrix.cassandra_version }}
143- # keypath="$(pwd)/testdata/pki"
144- # conf=(
145- # "client_encryption_options.enabled: true"
146- # "client_encryption_options.keystore: $keypath/.keystore"
147- # "client_encryption_options.keystore_password: cassandra"
148- # "client_encryption_options.require_client_auth: true"
149- # "client_encryption_options.truststore: $keypath/.truststore"
150- # "client_encryption_options.truststore_password: cassandra"
151- # "concurrent_reads: 2"
152- # "concurrent_writes: 2"
153- # "write_request_timeout_in_ms: 5000"
154- # "read_request_timeout_in_ms: 5000"
155- # "authenticator: PasswordAuthenticator"
156- # "authorizer: CassandraAuthorizer"
157- # "enable_user_defined_functions: true"
158- # )
159- #
160- # if [[ $VERSION == 3.*.* ]]; then
161- # conf+=(
162- # "rpc_server_type: sync"
163- # "rpc_min_threads: 2"
164- # "rpc_max_threads: 2"
165- # "enable_user_defined_functions: true"
166- # "enable_materialized_views: true"
167- # )
168- # elif [[ $VERSION == 4.0.* ]]; then
169- # conf+=(
170- # "enable_user_defined_functions: true"
171- # "enable_materialized_views: true"
172- # )
173- # else
174- # conf+=(
175- # "user_defined_functions_enabled: true"
176- # "materialized_views_enabled: true"
177- # )
178- # fi
179- #
180- # ccm remove test || true
181- #
182- # ccm create test -v $VERSION -n 1 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
183- # ccm updateconf "${conf[@]}"
184- #
185- # rm -rf $HOME/.ccm/test/node1/data/system_auth
186- #
187- # export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
188- #
189- # ccm start --wait-for-binary-proto --verbose
190- # ccm status
191- # ccm node1 nodetool status
192- #
193- # args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=1 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
194- #
195- # echo "args=$args" >> $GITHUB_ENV
196- # echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
197- # sleep 30s
198- # - name: Integration tests
199- # run: |
200- # export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
201- # go test -v -run=TestAuthentication -tags "${{ matrix.tags }} gocql_debug" -timeout=15s -runauth ${{ env.args }}
202- #
25+
20326 integration-testscontainers :
20427 needs : build
20528 runs-on : ubuntu-latest
206- name : testcontainers-go
29+ name : integration-testscontainers
20730 strategy :
20831 matrix :
209- go : [ '1.20' ]
32+ go : [ '1.20', '1.21' ]
21033 cassandra_version : [ '4.0.8', '4.1.1' ]
21134 auth : [ "false" ]
21235 compressor : [ "snappy" ]
21336 tags : [ "cassandra", "integration"]
21437 steps :
215- - uses : actions/checkout@v2
216- - uses : actions/setup-go@v2
38+ - uses : actions/checkout@v3
39+ - uses : actions/setup-go@v4
21740 with :
21841 go-version : ${{ matrix.go }}
21942 - name : setup
@@ -222,4 +45,28 @@ jobs:
22245 echo "args=$args" >> $GITHUB_ENV
22346 - name : run
22447 run : |
225- go test -v -tags "${{ matrix.tags }} gocql_debug" -timeout=5m -race ${{ env.args }}
48+ go test -v -tags "${{ matrix.tags }} gocql_debug" -timeout=5m -race ${{ env.args }}
49+
50+ integration-auth-testscontainers :
51+ needs : build
52+ runs-on : ubuntu-latest
53+ name : integration-auth-testscontainers
54+ strategy :
55+ matrix :
56+ go : [ '1.20', '1.21' ]
57+ cassandra_version : [ '4.0.8', '4.1.1' ]
58+ auth : [ "false" ]
59+ compressor : [ "snappy" ]
60+ tags : [ "cassandra", "integration"]
61+ steps :
62+ - uses : actions/checkout@v3
63+ - uses : actions/setup-go@v4
64+ with :
65+ go-version : ${{ matrix.go }}
66+ - name : setup
67+ run : |
68+ args="-gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=1 -autowait=2000ms -runauth -compressor=${{ matrix.compressor }} -gocql.cversion=${{ matrix.cassandra_version }} ./..."
69+ echo "args=$args" >> $GITHUB_ENV
70+ - name : run
71+ run : |
72+ go test -v -run=TestAuthentication -tags "${{ matrix.tags }} gocql_debug" -timeout=15s -runauth ${{ env.args }}
0 commit comments