Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate GZoltar #3448

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/integration-gzoltar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
name: Integration with GZoltar Fault Localization

on:
push:
paths-ignore:
- "docs/**"
- "**/*.md"
- "**/*.rst"
branches:
- master
- "[0-9].[0-9]"
pull_request:
branches:
- master
- "[0-9].[0-9]"
schedule:
- cron: "0 1 * * *" # nightly build

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v2
- name: Set up publishing to maven central
uses: actions/setup-java@v2
with:
java-version: "8"
distribution: "temurin"
- name: System setup
run: |
sudo apt update
sudo apt install -y stunnel make
make system-setup
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.m2/repository
/var/cache/apt
key: jedis-${{hashFiles('**/pom.xml')}}
- name: Maven offline
run: |
mvn -q dependency:go-offline
- name: Run tests
run: |
TEST="" make test-gzoltar
env:
JVM_OPTS: -Xmx3200m
TERM: dumb
- name: sleep 10s
run: sleep 10s
- name: Make - start
run: |
make start
sleep 2s
- name: Docker - mod or stack
run: docker run -p 52567:6379 -d redis/redis-stack-server:edge
- name: Test commands - default protocol
run: mvn -P gzoltar-sufire -Dtest="redis.clients.jedis.commands.**" gzoltar:prepare-agent test
- name: Test commands - RESP3 protocol
run: mvn -P gzoltar-sufire -DjedisProtocol=3 -Dtest="redis.clients.jedis.commands.**" gzoltar:prepare-agent test
- name: Test module commands - default protocol
run: mvn -P gzoltar-sufire -DmodulesDocker="localhost:52567" -Dtest="redis.clients.jedis.modules.**" gzoltar:prepare-agent test
- name: Test module commands - RESP3 protocol
run: mvn -P gzoltar-sufire -DjedisProtocol=3 -DmodulesDocker="localhost:52567" -Dtest="redis.clients.jedis.modules.**" gzoltar:prepare-agent test
- name: Make - stop
run: make stop
- name: Generate GZoltar report
run: mvn gzoltar:fl-report
- name: Enhance GZoltar results
uses: GZoltar/gzoltar-feedback-action@main
env:
NODE_OPTIONS: "--max-old-space-size=16384"
with:
build-path: "/target/site/gzoltar"
sfl-ranking: "[ochiai]"
sfl-threshold: "[0.5]"
sfl-ranking-order: "ochiai"
upload-artifacts: true
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ test: compile-module start
mvn -Dtest=${SKIP_SSL}${TEST} clean compile test
make stop

test-gzoltar: compile-module start
sleep 2
mvn -P gzoltar-sufire -Dtest=${SKIP_SSL}${TEST} clean compile gzoltar:prepare-agent test
make stop

package: start
mvn clean package
make stop
Expand Down
109 changes: 109 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<slf4j.version>1.7.36</slf4j.version>
<jedis.module.name>redis.clients.jedis</jedis.module.name>
<resilience4j.version>1.7.1</resilience4j.version>
<gzoltar.version>1.7.3</gzoltar.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -134,6 +135,13 @@
<version>${resilience4j.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.gzoltar</groupId>
<artifactId>com.gzoltar.agent</artifactId>
<classifier>runtime</classifier>
<version>${gzoltar.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<distributionManagement>
Expand Down Expand Up @@ -277,6 +285,49 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.gzoltar</groupId>
<artifactId>com.gzoltar.maven</artifactId>
<version>${gzoltar.version}</version>
<executions>
<execution>
<id>fl-report</id>
<goals>
<goal>fl-report</goal>
</goals>
<configuration>
<granularity>line</granularity>
<inclPublicMethods>true</inclPublicMethods>
<inclStaticConstructors>true</inclStaticConstructors>
<inclDeprecatedMethods>true</inclDeprecatedMethods>
<flFamilies>
<flFamily>
<name>sfL</name>
<formulas>
<formula>ochiai</formula>
</formulas>
<metrics>
<metric>rho</metric>
<metric>ambiguity</metric>
<metric>entropy</metric>
</metrics>
<formatters>
<format
implementation="com.gzoltar.report.fl.config.ConfigTxtReportFormatter" />
<format
implementation="com.gzoltar.report.fl.config.ConfigHTMLReportFormatter">
<htmlViews>
<htmlView>sunburst</htmlView>
<htmlView>vertical_partition</htmlView>
</htmlViews>
</format>
</formatters>
</flFamily>
</flFamilies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
Expand Down Expand Up @@ -321,5 +372,63 @@
</plugins>
</build>
</profile>
<profile>
<id>gzoltar-sufire</id>
<activation>
<property>
<name>gzoltar-sufire</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<configuration>
<skip>true</skip> <!-- Disabling plugin when using this profile -->
</configuration>
</plugin>

<plugin>
<groupId>com.gzoltar</groupId>
<artifactId>com.gzoltar.maven</artifactId>
<version>${gzoltar.version}</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<systemPropertyVariables>
<gzoltar-agent.destfile>${project.build.directory}/gzoltar.ser</gzoltar-agent.destfile>
</systemPropertyVariables>
<properties>
<property>
<name>listener</name>
<value>com.gzoltar.internal.core.listeners.JUnitListener</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>