Skip to content

Commit 183fd6a

Browse files
committed
removed IT tests from compile step
1 parent 8b9325a commit 183fd6a

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
compile:
3939
runs-on: ubuntu-latest
4040
timeout-minutes: 15
41-
name: Compile using JDK 8
41+
name: Compile (JDK 8)
4242
steps:
4343
- name: Check out repository
4444
uses: actions/checkout@v4
@@ -56,23 +56,15 @@ jobs:
5656
21
5757
cache: "maven"
5858
- name: Build and install libraries
59-
run: mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -DclickhouseVersion=$PREFERRED_LTS_VERSION -Dj8 install
59+
run: mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -Dj8 -DskipITs install
6060
- name: Compile examples
6161
run: |
6262
export LIB_VER=$(grep '<revision>' pom.xml | sed -e 's|[[:space:]]*<[/]*revision>[[:space:]]*||g')
6363
find `pwd`/examples -type f -name pom.xml -exec sed -i -e "s|\(<clickhouse-java.version>\).*\(<\)|\1$LIB_VER\2|g" {} \;
6464
for d in $(ls -d `pwd`/examples/*/); do \
6565
if [ -e $d/pom.xml ]; then cd $d && mvn --batch-mode --no-transfer-progress clean compile; fi;
6666
if [ -e $d/gradlew ]; then cd $d && ./gradlew clean build; fi;
67-
done
68-
- name: Upload test results
69-
uses: actions/upload-artifact@v4
70-
if: failure()
71-
with:
72-
name: result ${{ github.job }}
73-
path: |
74-
**/target/failsafe-reports
75-
**/target/surefire-reports
67+
done
7668
7769
test-multi-env:
7870
needs: compile
@@ -192,9 +184,6 @@ jobs:
192184
</toolchains>
193185
EOF
194186
- name: Test Java client
195-
# env:
196-
# CLICKHOUSE_CLOUD_HOST: ${{ secrets.CLOUD_INSTANCE_HOST }}
197-
# CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.CLOUD_INSTANCE_PASSWORD }}
198187
run: |
199188
mvn --also-make --batch-mode --no-transfer-progress --projects clickhouse-http-client,client-v2 -DclickhouseVersion=${{ matrix.clickhouse }} verify
200189
- name: Upload test results

client-v2/src/test/java/com/clickhouse/client/command/CommandTests.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
import com.clickhouse.client.BaseIntegrationTest;
44
import com.clickhouse.client.ClickHouseNode;
55
import com.clickhouse.client.ClickHouseProtocol;
6+
import com.clickhouse.client.ClickHouseServerForTest;
67
import com.clickhouse.client.api.Client;
78
import com.clickhouse.client.api.ClientException;
89
import com.clickhouse.client.api.ServerException;
910
import com.clickhouse.client.api.command.CommandResponse;
1011
import com.clickhouse.client.api.enums.Protocol;
12+
import com.clickhouse.client.api.internal.ServerSettings;
1113
import org.testng.Assert;
1214
import org.testng.annotations.BeforeMethod;
1315
import org.testng.annotations.Test;
@@ -21,14 +23,7 @@ public class CommandTests extends BaseIntegrationTest {
2123

2224
@BeforeMethod(groups = {"integration"})
2325
public void setUp() {
24-
ClickHouseNode node = getServer(ClickHouseProtocol.HTTP);
25-
client = new Client.Builder()
26-
.addEndpoint(Protocol.HTTP, node.getHost(), node.getPort(), false)
27-
.setUsername("default")
28-
.setPassword("")
29-
.build();
30-
31-
System.out.println("Real port: " + node.getPort());
26+
client = newClient().build();
3227
}
3328

3429

@@ -54,4 +49,17 @@ public void testInvalidCommandExecution() throws Exception {
5449
// expected
5550
}
5651
}
52+
53+
protected Client.Builder newClient() {
54+
ClickHouseNode node = getServer(ClickHouseProtocol.HTTP);
55+
boolean isSecure = isCloud();
56+
return new Client.Builder()
57+
.addEndpoint(Protocol.HTTP, node.getHost(), node.getPort(), isSecure)
58+
.setUsername("default")
59+
.setPassword(ClickHouseServerForTest.getPassword())
60+
.compressClientRequest(false)
61+
.setDefaultDatabase(ClickHouseServerForTest.getDatabase())
62+
.serverSetting(ServerSettings.WAIT_END_OF_QUERY, "1")
63+
.useNewImplementation(System.getProperty("client.tests.useNewImplementation", "true").equals("true"));
64+
}
5765
}

0 commit comments

Comments
 (0)