Skip to content

Commit

Permalink
removed IT tests from compile step
Browse files Browse the repository at this point in the history
  • Loading branch information
chernser committed Dec 20, 2024
1 parent 8b9325a commit 183fd6a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
compile:
runs-on: ubuntu-latest
timeout-minutes: 15
name: Compile using JDK 8
name: Compile (JDK 8)
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -56,23 +56,15 @@ jobs:
21
cache: "maven"
- name: Build and install libraries
run: mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -DclickhouseVersion=$PREFERRED_LTS_VERSION -Dj8 install
run: mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -Dj8 -DskipITs install
- name: Compile examples
run: |
export LIB_VER=$(grep '<revision>' pom.xml | sed -e 's|[[:space:]]*<[/]*revision>[[:space:]]*||g')
find `pwd`/examples -type f -name pom.xml -exec sed -i -e "s|\(<clickhouse-java.version>\).*\(<\)|\1$LIB_VER\2|g" {} \;
for d in $(ls -d `pwd`/examples/*/); do \
if [ -e $d/pom.xml ]; then cd $d && mvn --batch-mode --no-transfer-progress clean compile; fi;
if [ -e $d/gradlew ]; then cd $d && ./gradlew clean build; fi;
done
- name: Upload test results
uses: actions/upload-artifact@v4
if: failure()
with:
name: result ${{ github.job }}
path: |
**/target/failsafe-reports
**/target/surefire-reports
done
test-multi-env:
needs: compile
Expand Down Expand Up @@ -192,9 +184,6 @@ jobs:
</toolchains>
EOF
- name: Test Java client
# env:
# CLICKHOUSE_CLOUD_HOST: ${{ secrets.CLOUD_INSTANCE_HOST }}
# CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.CLOUD_INSTANCE_PASSWORD }}
run: |
mvn --also-make --batch-mode --no-transfer-progress --projects clickhouse-http-client,client-v2 -DclickhouseVersion=${{ matrix.clickhouse }} verify
- name: Upload test results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import com.clickhouse.client.BaseIntegrationTest;
import com.clickhouse.client.ClickHouseNode;
import com.clickhouse.client.ClickHouseProtocol;
import com.clickhouse.client.ClickHouseServerForTest;
import com.clickhouse.client.api.Client;
import com.clickhouse.client.api.ClientException;
import com.clickhouse.client.api.ServerException;
import com.clickhouse.client.api.command.CommandResponse;
import com.clickhouse.client.api.enums.Protocol;
import com.clickhouse.client.api.internal.ServerSettings;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
Expand All @@ -21,14 +23,7 @@ public class CommandTests extends BaseIntegrationTest {

@BeforeMethod(groups = {"integration"})
public void setUp() {
ClickHouseNode node = getServer(ClickHouseProtocol.HTTP);
client = new Client.Builder()
.addEndpoint(Protocol.HTTP, node.getHost(), node.getPort(), false)
.setUsername("default")
.setPassword("")
.build();

System.out.println("Real port: " + node.getPort());
client = newClient().build();
}


Expand All @@ -54,4 +49,17 @@ public void testInvalidCommandExecution() throws Exception {
// expected
}
}

protected Client.Builder newClient() {
ClickHouseNode node = getServer(ClickHouseProtocol.HTTP);
boolean isSecure = isCloud();
return new Client.Builder()
.addEndpoint(Protocol.HTTP, node.getHost(), node.getPort(), isSecure)
.setUsername("default")
.setPassword(ClickHouseServerForTest.getPassword())
.compressClientRequest(false)
.setDefaultDatabase(ClickHouseServerForTest.getDatabase())
.serverSetting(ServerSettings.WAIT_END_OF_QUERY, "1")
.useNewImplementation(System.getProperty("client.tests.useNewImplementation", "true").equals("true"));
}
}

0 comments on commit 183fd6a

Please sign in to comment.