Skip to content

Commit b95aaa1

Browse files
authored
Merge pull request #1 from hugofpaiva/feat/gzoltar-integration
feat: add GZoltar Fault Localization on tests
2 parents 1da50e0 + a0f457e commit b95aaa1

File tree

3 files changed

+210
-7
lines changed

3 files changed

+210
-7
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: Integration with GZoltar Fault Localization
3+
4+
on:
5+
push:
6+
paths-ignore:
7+
- "docs/**"
8+
- "**/*.md"
9+
- "**/*.rst"
10+
branches:
11+
- master
12+
- "[0-9].[0-9]"
13+
pull_request:
14+
branches:
15+
- master
16+
- "[0-9].[0-9]"
17+
schedule:
18+
- cron: "0 1 * * *" # nightly build
19+
20+
jobs:
21+
build:
22+
name: Build and Test
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: write
26+
pull-requests: write
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Set up publishing to maven central
30+
uses: actions/setup-java@v2
31+
with:
32+
java-version: "8"
33+
distribution: "temurin"
34+
- name: System setup
35+
run: |
36+
sudo apt update
37+
sudo apt install -y stunnel make
38+
make system-setup
39+
- name: Cache dependencies
40+
uses: actions/cache@v2
41+
with:
42+
path: |
43+
~/.m2/repository
44+
/var/cache/apt
45+
key: jedis-${{hashFiles('**/pom.xml')}}
46+
- name: Maven offline
47+
run: |
48+
mvn -q dependency:go-offline
49+
- name: Build docs
50+
run: |
51+
mvn javadoc:jar
52+
- name: Run tests
53+
run: |
54+
TEST="" make test-gzoltar
55+
env:
56+
JVM_OPTS: -Xmx3200m
57+
TERM: dumb
58+
- name: Make - start
59+
run: make start
60+
- name: Docker - mod or stack
61+
run: docker run -p 52567:6379 -d redis/redis-stack-server:edge
62+
- name: Test commands - default protocol
63+
run: mvn -P gzoltar-sufire -Dtest="redis.clients.jedis.commands.**" gzoltar:prepare-agent test
64+
- name: Test commands - RESP3 protocol
65+
run: mvn -P gzoltar-sufire -DjedisProtocol=3 -Dtest="redis.clients.jedis.commands.**" gzoltar:prepare-agent test
66+
- name: Test module commands - default protocol
67+
run: mvn -P gzoltar-sufire -DmodulesDocker="localhost:52567" -Dtest="redis.clients.jedis.modules.**" gzoltar:prepare-agent test
68+
- name: Test module commands - RESP3 protocol
69+
run: mvn -P gzoltar-sufire -DjedisProtocol=3 -DmodulesDocker="localhost:52567" -Dtest="redis.clients.jedis.modules.**" gzoltar:prepare-agent test
70+
- name: Make - stop
71+
run: make stop
72+
- name: Generate GZoltar report
73+
run: mvn gzoltar:fl-report
74+
- name: Enhance GZoltar results
75+
uses: hugofpaiva/gzoltar-feedback-action@main
76+
env:
77+
NODE_OPTIONS: "--max-old-space-size=8192"
78+
with:
79+
build-path: "/target/site/gzoltar"
80+
sfl-ranking: "[ochiai]"
81+
sfl-threshold: "[0.5]"
82+
sfl-ranking-order: "ochiai"
83+
upload-artifacts: true

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,11 @@ test: compile-module start
445445
mvn -Dtest=${SKIP_SSL}${TEST} clean compile test
446446
make stop
447447

448+
test-gzoltar: compile-module start
449+
sleep 2
450+
mvn -P gzoltar-sufire -Dtest=${SKIP_SSL}${TEST} clean compile gzoltar:prepare-agent test
451+
make stop
452+
448453
package: start
449454
mvn clean package
450455
make stop

pom.xml

Lines changed: 122 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
24
<parent>
35
<groupId>org.sonatype.oss</groupId>
46
<artifactId>oss-parent</artifactId>
@@ -48,6 +50,10 @@
4850
<github.global.server>github</github.global.server>
4951
<slf4j.version>1.7.36</slf4j.version>
5052
<jedis.module.name>redis.clients.jedis</jedis.module.name>
53+
<junit.version>4.13.2</junit.version>
54+
<gzoltar.version>1.7.3</gzoltar.version>
55+
<surefire.version>3.0.0</surefire.version>
56+
<jacoco.version>0.8.5</jacoco.version>
5157
</properties>
5258

5359
<dependencies>
@@ -75,7 +81,7 @@
7581
<dependency>
7682
<groupId>junit</groupId>
7783
<artifactId>junit</artifactId>
78-
<version>4.13.2</version>
84+
<version>${junit.version}</version>
7985
<scope>test</scope>
8086
</dependency>
8187
<dependency>
@@ -115,6 +121,13 @@
115121
<version>2.14.2</version>
116122
<scope>test</scope>
117123
</dependency>
124+
<dependency>
125+
<groupId>com.gzoltar</groupId>
126+
<artifactId>com.gzoltar.agent</artifactId>
127+
<classifier>runtime</classifier>
128+
<version>${gzoltar.version}</version>
129+
<scope>test</scope>
130+
</dependency>
118131
</dependencies>
119132

120133
<distributionManagement>
@@ -139,7 +152,7 @@
139152
<plugin>
140153
<groupId>org.jacoco</groupId>
141154
<artifactId>jacoco-maven-plugin</artifactId>
142-
<version>0.8.5</version>
155+
<version>${jacoco.version}</version>
143156
<executions>
144157
<execution>
145158
<goals>
@@ -165,7 +178,7 @@
165178
</plugin>
166179
<plugin>
167180
<artifactId>maven-surefire-plugin</artifactId>
168-
<version>3.0.0</version>
181+
<version>${surefire.version}</version>
169182
<configuration>
170183
<systemPropertyVariables>
171184
<redis-hosts>${redis-hosts}</redis-hosts>
@@ -258,14 +271,58 @@
258271
</execution>
259272
</executions>
260273
</plugin>
274+
<plugin>
275+
<groupId>com.gzoltar</groupId>
276+
<artifactId>com.gzoltar.maven</artifactId>
277+
<version>${gzoltar.version}</version>
278+
<executions>
279+
<execution>
280+
<id>fl-report</id>
281+
<goals>
282+
<goal>fl-report</goal>
283+
</goals>
284+
<configuration>
285+
<granularity>line</granularity>
286+
<inclPublicMethods>true</inclPublicMethods>
287+
<inclStaticConstructors>true</inclStaticConstructors>
288+
<inclDeprecatedMethods>true</inclDeprecatedMethods>
289+
<flFamilies>
290+
<flFamily>
291+
<name>sfL</name>
292+
<formulas>
293+
<formula>ochiai</formula>
294+
</formulas>
295+
<metrics>
296+
<metric>rho</metric>
297+
<metric>ambiguity</metric>
298+
<metric>entropy</metric>
299+
</metrics>
300+
<formatters>
301+
<format
302+
implementation="com.gzoltar.report.fl.config.ConfigTxtReportFormatter" />
303+
<format
304+
implementation="com.gzoltar.report.fl.config.ConfigHTMLReportFormatter">
305+
<htmlViews>
306+
<htmlView>sunburst</htmlView>
307+
<htmlView>vertical_partition</htmlView>
308+
</htmlViews>
309+
</format>
310+
</formatters>
311+
</flFamily>
312+
</flFamilies>
313+
</configuration>
314+
</execution>
315+
</executions>
316+
</plugin>
261317
</plugins>
262318
</build>
263319
<profiles>
264320
<profile>
265321
<id>release</id>
266322
<build>
267323
<plugins>
268-
<!--Sign the components - this is required by maven central for releases -->
324+
<!--Sign
325+
the components - this is required by maven central for releases -->
269326
<plugin>
270327
<artifactId>maven-gpg-plugin</artifactId>
271328
<version>3.0.1</version>
@@ -294,13 +351,71 @@
294351
<plugins>
295352
<plugin>
296353
<artifactId>maven-surefire-plugin</artifactId>
297-
<version>3.0.0</version>
354+
<version>${surefire.version}</version>
298355
<configuration>
299356
<test>**/examples/*Example.java</test>
300357
</configuration>
301358
</plugin>
302359
</plugins>
303360
</build>
304361
</profile>
362+
<profile>
363+
<id>gzoltar-sufire</id>
364+
<activation>
365+
<property>
366+
<name>gzoltar-sufire</name>
367+
</property>
368+
</activation>
369+
<build>
370+
<plugins>
371+
<plugin>
372+
<groupId>org.jacoco</groupId>
373+
<artifactId>jacoco-maven-plugin</artifactId>
374+
<version>${jacoco.version}</version>
375+
<configuration>
376+
<skip>true</skip> <!-- Disabling plugin when using this profile -->
377+
</configuration>
378+
</plugin>
379+
380+
<plugin>
381+
<groupId>com.gzoltar</groupId>
382+
<artifactId>com.gzoltar.maven</artifactId>
383+
<version>${gzoltar.version}</version>
384+
<dependencies>
385+
<dependency>
386+
<groupId>junit</groupId>
387+
<artifactId>junit</artifactId>
388+
<version>${junit.version}</version>
389+
</dependency>
390+
</dependencies>
391+
</plugin>
392+
393+
<plugin>
394+
<groupId>org.apache.maven.plugins</groupId>
395+
<artifactId>maven-surefire-plugin</artifactId>
396+
<version>${surefire.version}</version>
397+
<dependencies>
398+
<dependency>
399+
<groupId>org.apache.maven.surefire</groupId>
400+
<artifactId>surefire-junit47</artifactId>
401+
<version>${surefire.version}</version>
402+
</dependency>
403+
</dependencies>
404+
<configuration>
405+
<testFailureIgnore>true</testFailureIgnore>
406+
<systemPropertyVariables>
407+
<gzoltar-agent.destfile>${project.build.directory}/gzoltar.ser</gzoltar-agent.destfile>
408+
</systemPropertyVariables>
409+
<properties>
410+
<property>
411+
<name>listener</name>
412+
<value>com.gzoltar.internal.core.listeners.JUnitListener</value>
413+
</property>
414+
</properties>
415+
</configuration>
416+
</plugin>
417+
</plugins>
418+
</build>
419+
</profile>
305420
</profiles>
306-
</project>
421+
</project>

0 commit comments

Comments
 (0)