You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by yc...@apache.org on 2022/10/17 22:38:13 UTC

[cassandra-sidecar] branch trunk updated: ninja fix: CircleCI config changes following up CASSANDRASC-46

This is an automated email from the ASF dual-hosted git repository.

ycai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-sidecar.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 1759eb5  ninja fix: CircleCI config changes following up CASSANDRASC-46
1759eb5 is described below

commit 1759eb535ff2dbd3dea3fa8626eba0fe70ecb113
Author: Francisco Guerrero <fr...@apple.com>
AuthorDate: Fri Oct 14 13:05:45 2022 -0700

    ninja fix: CircleCI config changes following up CASSANDRASC-46
---
 .circleci/config.yml                               | 31 +++++++---------------
 .circleci/setup-microk8.sh                         | 23 ----------------
 cassandra-integration-tests/build.gradle           | 10 +++++++
 .../common/testing/TestVersionSupplier.java        |  2 +-
 cassandra40/build.gradle                           |  3 +--
 common/build.gradle                                |  1 -
 docs/src/development.adoc                          |  5 ++--
 7 files changed, 23 insertions(+), 52 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index f5350d1..18ebecd 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -23,7 +23,7 @@ aliases:
 # we might modify this in the future to accept a parameter for the java package to install
 commands:
   install_java:
-    description: "Installs Java 8 using AdoptOpenJDK"
+    description: "Installs Java using AdoptOpenJDK"
     parameters:
       version:
         type: string
@@ -33,11 +33,6 @@ commands:
       - run: sudo apt-get update
       - run: sudo apt-get install -y << parameters.version>>
 
-  install_kube:
-    description: "Installs kubernetes"
-    steps:
-      - run: .circleci/setup-microk8.sh
-
   install_common:
     description: "Installs common software and certificates"
     steps:
@@ -45,14 +40,14 @@ commands:
       - run: sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
 
 jobs:
+  # Runs java 8 tests on a docker image
   java8_docker:
     docker:
      - image: circleci/openjdk:8-jdk-stretch
     steps:
      - checkout
 
-     # setting the docker registry here skips the internal minikube setup
-     - run: SIDECAR_DOCKER_REGISTRY="127.0.0.1" ./gradlew -i clean test  --stacktrace
+     - run: ./gradlew -i clean test -x :cassandra-integration-tests:test --stacktrace
 
      - store_artifacts:
          path: build/reports
@@ -61,23 +56,18 @@ jobs:
      - store_test_results:
          path: ~/repo/build/test-results/
 
+  # Runs java 8 tests on a VM to be able to run Docker for integration tests
   java8:
     <<: *base_job
 
-    # todo move to common command for integration tests
-    environment:
-      SIDECAR_DOCKER_REGISTRY: "http://localhost:32000"
-
     steps:
       - checkout
       - install_common
-      - install_kube
 
       - install_java:
           version: adoptopenjdk-8-hotspot
       - run: sudo update-java-alternatives -s adoptopenjdk-8-hotspot-amd64 && java -version
-      - run: ./gradlew :containers:pushAll
-      - run: ./gradlew -i test integrationTest --stacktrace
+      - run: ./gradlew -i clean test --stacktrace
 
       - store_artifacts:
           path: build/reports
@@ -89,13 +79,14 @@ jobs:
       - store_test_results:
           path: ~/repo/cassandra-integration-tests/build/test-results/
 
+  # Runs java 11 tests on a docker image
   java11_docker:
     docker:
       - image: circleci/openjdk:11-jdk-stretch
     steps:
       - checkout
 
-      - run: SIDECAR_DOCKER_REGISTRY="127.0.0.1" ./gradlew -i clean test --stacktrace
+      - run: ./gradlew -i clean test -x :cassandra-integration-tests:test --stacktrace
 
       - store_artifacts:
           path: build/reports
@@ -104,22 +95,18 @@ jobs:
       - store_test_results:
           path: ~/repo/build/test-results/
 
+  # Runs java 11 tests on a VM to be able to run Docker for integration tests
   java11:
     <<: *base_job
-    environment:
-      SIDECAR_DOCKER_REGISTRY: "http://localhost:32000"
 
     steps:
       - checkout
       - install_common
-      - install_kube
 
       - install_java:
           version: adoptopenjdk-11-hotspot
       - run: sudo update-java-alternatives -s adoptopenjdk-11-hotspot-amd64 && java -version
-      - run: export
-      - run: ./gradlew :containers:pushAll
-      - run: ./gradlew -i test integrationTest --stacktrace
+      - run: ./gradlew -i clean test --stacktrace
 
       - store_artifacts:
           path: build/reports
diff --git a/.circleci/setup-microk8.sh b/.circleci/setup-microk8.sh
deleted file mode 100755
index d8abafa..0000000
--- a/.circleci/setup-microk8.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -v
-
-sudo snap install microk8s --classic
-
-sudo microk8s status --wait-ready
-sudo microk8s enable registry
-sudo microk8s status --wait-ready
-sudo microk8s status -a registry -wait-ready
-
-curl http://localhost:32000/v2/_catalog
-
-sudo mkdir -p ~/.kube
-sudo chown -R circleci ~/.kube
-
-sudo microk8s config > ~/.kube/config
-sudo chown -R circleci ~/.kube
-
-cat ~/.kube/config
-
-sudo microk8s kubectl get all
-sudo iptables -P FORWARD ACCEPT
\ No newline at end of file
diff --git a/cassandra-integration-tests/build.gradle b/cassandra-integration-tests/build.gradle
index 11c80a9..54068ba 100644
--- a/cassandra-integration-tests/build.gradle
+++ b/cassandra-integration-tests/build.gradle
@@ -24,3 +24,13 @@ dependencies {
 test {
     useJUnitPlatform()
 }
+
+tasks.register("integrationTest", Test) {
+    jacoco {
+        enabled = false
+    }
+    useJUnitPlatform() {
+        includeTags "integrationTest"
+    }
+    group = "verification"
+}
diff --git a/cassandra-integration-tests/src/test/java/org/apache/cassandra/sidecar/common/testing/TestVersionSupplier.java b/cassandra-integration-tests/src/test/java/org/apache/cassandra/sidecar/common/testing/TestVersionSupplier.java
index 4703f92..a5961ad 100644
--- a/cassandra-integration-tests/src/test/java/org/apache/cassandra/sidecar/common/testing/TestVersionSupplier.java
+++ b/cassandra-integration-tests/src/test/java/org/apache/cassandra/sidecar/common/testing/TestVersionSupplier.java
@@ -38,7 +38,7 @@ public class TestVersionSupplier
 {
     Stream<TestVersion> getTestVersions()
     {
-        return Stream.of(new TestVersion("4.0.0", new Cassandra40Factory(), "cassandra:4.0.6"));
+        return Stream.of(new TestVersion("4.0.0", new Cassandra40Factory(), "cassandra:4.0"));
     }
 
 }
diff --git a/cassandra40/build.gradle b/cassandra40/build.gradle
index cf71cce..ee71e39 100644
--- a/cassandra40/build.gradle
+++ b/cassandra40/build.gradle
@@ -10,9 +10,8 @@ sourceCompatibility = 1.8
 
 repositories {
     mavenCentral()
-    jcenter()
 }
 
 dependencies {
     compile project(":common")
-}
\ No newline at end of file
+}
diff --git a/common/build.gradle b/common/build.gradle
index 04cf2f5..0a01492 100644
--- a/common/build.gradle
+++ b/common/build.gradle
@@ -15,7 +15,6 @@ sourceCompatibility = 1.8
 
 repositories {
     mavenCentral()
-    jcenter()
 }
 
 test {
diff --git a/docs/src/development.adoc b/docs/src/development.adoc
index d89e68c..0f0841e 100644
--- a/docs/src/development.adoc
+++ b/docs/src/development.adoc
@@ -27,7 +27,7 @@ Cassandra integration tests leverage Docker to create Cassandra nodes and test t
 of the ICassandraAdapters against real C* nodes.
 
 The integration tests will not run by default when running `./gradlew test` since they require a bit of setup and you may not have
-Kubernetes available.
+Docker available.
 
 #### Running Integration Tests
 
@@ -36,7 +36,6 @@ Integration tests can be run with the following:
     ./gradlew integrationTest
 
 
-
 #### Tests
 
 Tests in the cassandra-integration-tests submodule should be marked as integration tests with the @CassandraIntegrationTest annotation:
@@ -47,7 +46,7 @@ Tests in the cassandra-integration-tests submodule should be marked as integrati
         //
     }
 
-The `CassandraTestTemplate` will handle starting up each of the Kubernetes services required for testing and inject the
+The `CassandraTestTemplate` will handle starting up each of the Docker services required for testing and inject the
 `CassandraTestContext`, which will have the version, CQLSession, container, and other useful information required for testing.
 
 ### Main Project


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org