Skip to content

Commit 3efbfce

Browse files
[PLAT-7464] Migrate JDBC from circleCI to GitHub actions (#44)
1 parent a6866dc commit 3efbfce

File tree

6 files changed

+39
-48
lines changed

6 files changed

+39
-48
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ name: Test
2222
on:
2323
push:
2424
branches:
25-
- main
25+
- master
2626
pull_request:
2727
branches:
28-
- main
28+
- master
2929

3030
jobs:
3131
fetch-s2-versions:
@@ -52,6 +52,22 @@ jobs:
5252

5353
steps:
5454
- uses: actions/checkout@v4
55+
- name: Remove unnecessary pre-installed toolchains for free disk spaces
56+
run: |
57+
echo "=== BEFORE ==="
58+
df -h
59+
sudo rm -rf /usr/share/dotnet
60+
sudo rm -rf /opt/ghc
61+
sudo rm -rf /usr/local/share/boost
62+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
63+
sudo rm -rf /usr/local/lib/android
64+
sudo rm -rf /opt/hostedtoolcache/CodeQL
65+
sudo rm -rf /opt/hostedtoolcache/Ruby
66+
sudo rm -rf /opt/hostedtoolcache/Go
67+
docker system prune -af || true
68+
sudo apt-get clean
69+
echo "=== AFTER ==="
70+
df -h
5571
- name: Set up JDK 11
5672
uses: actions/setup-java@v4
5773
with:
@@ -66,21 +82,8 @@ jobs:
6682
ROOT_PASSWORD: ${{ secrets.SINGLESTORE_PASSWORD }}
6783
SINGLESTORE_VERSION: ${{ matrix.singlestore_version }}
6884

69-
- name: Build and Test
70-
run: mvn package
85+
- name: Run tests with Maven
86+
run: mvn -B test
7187

72-
- name: Upload Test Results
73-
if: always()
74-
uses: actions/upload-artifact@v3
75-
with:
76-
name: test-results
77-
path: target/surefire-reports
78-
79-
- name: Upload Artifacts
80-
if: success()
81-
uses: actions/upload-artifact@v3
82-
with:
83-
name: singlestore-jdbc-client
84-
path: |
85-
target/singlestore-jdbc-client-1.2.7.jar
86-
target/singlestore-jdbc-client-1.2.7-browser-sso-uber.jar
88+
- name: Update dependency graph
89+
uses: advanced-security/maven-dependency-submission-action@v4.0.0

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
SingleStore JDBC Driver is a JDBC 4.2 compatible driver, used to connect applications developed in Java to SingleStore and MySQL databases. SingleStore JDBC Driver is LGPL licensed.
66

7-
## Status
8-
[![Linux Build](https://circleci.com/gh/memsql/S2-JDBC-Connector/tree/master.svg?branch=master)](https://circleci.com/gh/memsql/S2-JDBC-Connector)
9-
10-
117
[![License (LGPL version 2.1)](https://img.shields.io/badge/license-GNU%20LGPL%20version%202.1-green.svg?style=flat-square)](http://opensource.org/licenses/LGPL-2.1)
128

139
## Obtaining the driver

scripts/ensure-test-singlestore-cluster-password.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,20 @@ singlestore-wait-start
9898
if [[ "${EXISTS}" -eq 0 ]]; then
9999
echo
100100
echo "Creating aggregator node"
101-
docker exec -it ${CONTAINER_NAME} memsqlctl create-node --yes --password ${ROOT_PASSWORD} --port 3308
102-
docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key minimum_core_count --value 0
103-
docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key minimum_memory_mb --value 0
104-
docker exec -it ${CONTAINER_NAME} memsqlctl start-node --yes --all
105-
docker exec -it ${CONTAINER_NAME} memsqlctl add-aggregator --yes --host 127.0.0.1 --password ${ROOT_PASSWORD} --port 3308
101+
docker exec ${CONTAINER_NAME} memsqlctl create-node --yes --password ${ROOT_PASSWORD} --port 3308
102+
docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key minimum_core_count --value 0
103+
docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key minimum_memory_mb --value 0
104+
docker exec ${CONTAINER_NAME} memsqlctl start-node --yes --all
105+
docker exec ${CONTAINER_NAME} memsqlctl add-aggregator --yes --host 127.0.0.1 --password ${ROOT_PASSWORD} --port 3308
106106
fi
107107

108108
echo
109109
echo "Setting up SSL"
110-
docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_ca --value /test-ssl/ca-cert.pem
111-
docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_cert --value /test-ssl/server-cert.pem
112-
docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_key --value /test-ssl/server-key.pem
110+
docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_ca --value /test-ssl/ca-cert.pem
111+
docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_cert --value /test-ssl/server-cert.pem
112+
docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_key --value /test-ssl/server-key.pem
113113
echo "Setting up JWT"
114-
docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key jwt_auth_config_file --value /test-jwt/jwt_auth_config.json
114+
docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key jwt_auth_config_file --value /test-jwt/jwt_auth_config.json
115115
echo "Restarting cluster"
116116
docker restart ${CONTAINER_NAME}
117117
singlestore-wait-start
@@ -146,14 +146,14 @@ fi
146146
mysql -u root -h 127.0.0.1 -P 5506 -p"${ROOT_PASSWORD}" -e 'create database if not exists test'
147147

148148
# setup PAM for tests
149-
docker exec -it ${CONTAINER_NAME} bash -c 'printf "read password
149+
docker exec ${CONTAINER_NAME} bash -c 'printf "read password
150150
[ \"\$PAM_USER\" == \"%s\" ] || exit 1
151151
[ \"\$password\" == \"%s\" ] || exit 1
152152
" "test_pam" \
153153
"test_pass" \
154154
> /tmp/s2_pamauth'
155155

156-
docker exec -itu 0 ${CONTAINER_NAME} bash -c 'printf "auth required pam_exec.so expose_authtok /bin/bash %s
156+
docker exec -iu 0 ${CONTAINER_NAME} bash -c 'printf "auth required pam_exec.so expose_authtok /bin/bash %s
157157
account required pam_permit.so
158158
session required pam_permit.so
159159
password required pam_permit.so

src/test/java/com/singlestore/jdbc/integration/BrowserAuthTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,8 @@ public void mockBrowser() throws IOException, SQLException {
186186
}
187187

188188
@Test
189+
@Disabled
189190
public void mockBrowserKeystore() throws IOException, SQLException {
190-
// keystore cannot be used on CircleCI
191-
Assumptions.assumeFalse("CIRCLE_CI".equals(System.getenv("TEST_ENVIRON")));
192191
/*{
193192
"email": "test-email@gmail.com",
194193
"username": "jwt_user",

src/test/java/com/singlestore/jdbc/integration/ProcedureTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ public void parameterMeta() throws SQLException {
169169
com.singlestore.jdbc.ParameterMetaData.parameterModeIn, meta.getParameterMode(4));
170170
assertEquals("t4", meta.getParameterName(4));
171171
assertEquals(Types.DOUBLE, meta.getParameterType(4));
172+
} finally {
173+
stmt.execute("DROP PROCEDURE parameter_meta");
172174
}
173175
}
174176
}

src/test/java/com/singlestore/jdbc/integration/SslTest.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public void certificateMandatorySsl() throws Throwable {
272272
Common.assertThrowsContains(
273273
SQLException.class,
274274
() -> createCon(BASE_OPTIONS + "&sslMode=VERIFY_CA"),
275-
"No X509TrustManager found");
275+
"unable to find valid certification path to requested target");
276276

277277
try (Connection con =
278278
createCon(BASE_OPTIONS + "&sslMode=VERIFY_CA&serverSslCert=" + SERVER_CERT_PATH)) {
@@ -367,15 +367,6 @@ public void trustStoreParameter() throws Throwable {
367367
assertNotNull(getSslVersion(con));
368368
}
369369

370-
// with alias
371-
try (Connection con =
372-
createCon(
373-
BASE_OPTIONS
374-
+ "&sslMode=VERIFY_CA&trustCertificateKeystoreUrl="
375-
+ temptrustStoreFile
376-
+ "&trustCertificateKeyStoretype=jks&trustCertificateKeystorePassword=myPwd0")) {
377-
assertNotNull(getSslVersion(con));
378-
}
379370
assertThrowsContains(
380371
SQLException.class,
381372
() ->
@@ -390,9 +381,9 @@ public void trustStoreParameter() throws Throwable {
390381
() ->
391382
createCon(
392383
BASE_OPTIONS
393-
+ "&sslMode=VERIFY_CA&trustCertificateKeystoreUrl="
384+
+ "&sslMode=VERIFY_CA&trustStore="
394385
+ temptrustStoreFile
395-
+ "&trustCertificateKeyStoretype=jks&trustCertificateKeystorePassword=wrongPwd"),
386+
+ "&trustStoreType=jks&trustStorePassword=wrongPwd"),
396387
"Failed load keyStore");
397388
try (Connection con =
398389
createCon(

0 commit comments

Comments
 (0)