Skip to content

Commit

Permalink
Fix test bug and clean up debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhoon committed Dec 10, 2023
1 parent a194384 commit 479e43c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/e2e-chaos-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,44 @@ jobs:
distribution: "temurin"
java-version: 19

- name: Setup Minikube-Kubernetes
- name: Setup Minikube
id: minikube
uses: medyagh/setup-minikube@latest

- name: Install Chaos Mesh
run: |
curl -sSL https://mirrors.chaos-mesh.org/v${CHAOS_MESH_VERSION}/install.sh | bash
kubectl wait --for=condition=Ready pods --all-namespaces --all --timeout=600s
eval $(minikube -p minikube docker-env)
shell: bash

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build Chaos test images
run: |
# The images should be built in the minikube docker environment
eval $(minikube -p minikube docker-env)
./gradlew --no-daemon --stacktrace :it:kubernetes-chaos-tests:k8sBuild
shell: bash

- name: Run Chaos Tests - network-delay.yaml
env:
CHAOS_TEST: network-delay.yaml
run: |
./gradlew --no-daemon --stacktrace :it:kubernetes-chaos-tests:test --info
./gradlew --no-daemon --stacktrace :it:kubernetes-chaos-tests:test
shell: bash

- name: Run Chaos Tests - network-loss.yaml
env:
CHAOS_TEST: network-loss.yaml
run: |
./gradlew --no-daemon --stacktrace :it:kubernetes-chaos-tests:test --info --rerun-tasks
# --rerun-tasks is required to run the tests because only the environment variable is changed
./gradlew --no-daemon --stacktrace :it:kubernetes-chaos-tests:test --rerun-tasks
shell: bash

- name: Run Chaos Tests - network-duplication.yaml
env:
CHAOS_TEST: network-duplication.yaml
run: |
./gradlew --no-daemon --stacktrace :it:kubernetes-chaos-tests:test --info --rerun-tasks
./gradlew --no-daemon --stacktrace :it:kubernetes-chaos-tests:test --rerun-tasks
shell: bash
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ allprojects {
// Drop heap dump and exit on OOME.
jvmArgs '-XX:+ExitOnOutOfMemoryError'
jvmArgs '-XX:+HeapDumpOnOutOfMemoryError'
// jvmArgs "-Xdebug", "-agentlib:jdwp=transport=dt_socket,address=*:8787,server=y,suspend=y"

// `-Djava.security.manager` was added in Java 17 and the default value was changed to
// `disallow` in Java 18.
Expand Down
8 changes: 5 additions & 3 deletions dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ j2objc = "2.8"
jackson = "2.15.3"
jakarta-inject = "2.0.1"
jakarta-validation = "3.0.2"
jakarta-websocket= "2.1.1"
jakarta-websocket = "2.1.1"
java-websocket = "1.5.4"
javax-annotation = "1.3.2"
javax-inject = "1"
Expand All @@ -60,6 +60,7 @@ jetty11-jstl = "11.0.0"
jetty93 = "9.3.30.v20211001"
jetty94 = "9.4.51.v20230217"
jetty-alpn-api = "1.1.3.v20160715"
jkube = "1.15.0"
jmh-core = "1.37"
jmh-gradle-plugin = "0.7.1"
joor = "0.9.15"
Expand Down Expand Up @@ -203,11 +204,11 @@ module = "org.awaitility:awaitility"
version.ref = "awaitility"

[libraries.blockhound-junit-platform]
module="io.projectreactor.tools:blockhound-junit-platform"
module = "io.projectreactor.tools:blockhound-junit-platform"
version.ref = "blockhound"

[libraries.blockhound]
module="io.projectreactor.tools:blockhound"
module = "io.projectreactor.tools:blockhound"
version.ref = "blockhound"

[libraries.bouncycastle-bcpkix]
Expand Down Expand Up @@ -1343,6 +1344,7 @@ module = "io.github.resilience4j:resilience4j-micrometer"
version.ref = "resilience4j"

[plugins]
jkube = { id = "org.eclipse.jkube.kubernetes", version.ref = "jkube" }
jmh = { id = "me.champeau.jmh", version.ref = "jmh-gradle-plugin" }
osdetector = { id = "com.google.osdetector", version.ref = "osdetector" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
Expand Down
2 changes: 1 addition & 1 deletion it/kubernetes-chaos-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// TODO(ikhoon): Declare the version in dependencies.tom
plugins {
id 'org.eclipse.jkube.kubernetes' version '1.15.0'
alias libs.plugins.jkube
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.util.Map;
import java.util.Optional;

import com.google.common.base.MoreObjects;

import com.linecorp.armeria.common.ResponseHeaders;

import io.fabric8.kubernetes.client.http.AsyncBody;
Expand Down Expand Up @@ -79,10 +81,9 @@ public Map<String, List<String>> headers() {

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("ArmeriaHttpResponse{");
sb.append("responseHeaders=").append(responseHeaders);
sb.append(", body=").append(body);
sb.append('}');
return sb.toString();
return MoreObjects.toStringHelper(this)
.add("responseHeaders", responseHeaders)
.add("body", body)
.toString();
}
}
2 changes: 0 additions & 2 deletions testing-internal/src/main/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
<logger name="com.linecorp.armeria.logging.traffic.client" level="OFF" />
<logger name="com.linecorp.armeria.logging.traffic.client.http2" level="OFF" />
<logger name="com.linecorp.armeria.internal.common.Http2GoAwayHandler" level="INFO" />
<logger name="com.linecorp.armeria.client.kubernetes" level="TRACE" />
<logger name="io.netty.resolver.dns.TraceDnsQueryLifeCycleObserverFactory" level="DEBUG" />
<logger name="reactor" level="INFO" />
<logger name="io.fabric8.kubernetes" level="DEBUG" />
<logger name="example.armeria" level="DEBUG" />
<logger name="loggerTest" level="ALL" additivity="false">
<appender-ref ref="NOP" />
Expand Down

0 comments on commit 479e43c

Please sign in to comment.