Skip to content

Commit 785f47b

Browse files
committed
ALEC-295: Gate RegressionIT behind a demo-it Maven profile
cgorantla's review on PR #153 noted that RegressionIT depends on a live OpenNMS+ALEC instance and was running unconditionally as part of the default verify lifecycle. CI pipelines have no live OpenNMS to talk to, so the tests would fail (silently, in some configurations) on every run. Move the maven-failsafe-plugin execution into a new "demo-it" profile that is OFF by default. Default behaviour now: mvn -pl demo -am verify # builds, runs unit tests, no IT mvn -pl demo -am verify -Pdemo-it ... # opt-in: runs RegressionIT surefire still excludes **/*IT.java in the default phase, so unit tests in this module continue to run unaffected. README updated with the new invocation.
1 parent 8282f30 commit 785f47b

2 files changed

Lines changed: 49 additions & 22 deletions

File tree

demo/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,15 @@ OpenNMS topology view and ALEC's correlation graph.
127127

128128
## Regression Tests (Integration)
129129

130-
Requires a running OpenNMS+ALEC instance:
130+
`RegressionIT` requires a live OpenNMS+ALEC instance, so it is **not** bound
131+
to the default `verify` lifecycle (CI pipelines won't try to run it). Activate
132+
the `demo-it` profile to opt in:
131133

132134
```bash
133-
mvn verify -pl demo -Dopennms.url=http://localhost:8980/opennms
135+
mvn verify -pl demo -am -Pdemo-it \
136+
-Dopennms.url=http://localhost:8980/opennms \
137+
-Dopennms.username=admin \
138+
-Dopennms.password=admin
134139
```
135140

136141
## Engine-Level Tests (No OpenNMS Needed)

demo/pom.xml

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
<target>${java.version}</target>
2727
</configuration>
2828
</plugin>
29-
<!-- Skip integration tests by default -->
29+
<!-- Skip *IT.java in surefire — they are run only by the
30+
demo-it profile via failsafe (see <profiles> below). -->
3031
<plugin>
3132
<groupId>org.apache.maven.plugins</groupId>
3233
<artifactId>maven-surefire-plugin</artifactId>
@@ -36,25 +37,6 @@
3637
</excludes>
3738
</configuration>
3839
</plugin>
39-
<plugin>
40-
<groupId>org.apache.maven.plugins</groupId>
41-
<artifactId>maven-failsafe-plugin</artifactId>
42-
<configuration>
43-
<systemPropertyVariables>
44-
<opennms.url>${opennms.url}</opennms.url>
45-
<opennms.username>${opennms.username}</opennms.username>
46-
<opennms.password>${opennms.password}</opennms.password>
47-
</systemPropertyVariables>
48-
</configuration>
49-
<executions>
50-
<execution>
51-
<goals>
52-
<goal>integration-test</goal>
53-
<goal>verify</goal>
54-
</goals>
55-
</execution>
56-
</executions>
57-
</plugin>
5840
<!-- Make executable jar -->
5941
<plugin>
6042
<groupId>org.apache.maven.plugins</groupId>
@@ -169,4 +151,44 @@
169151
<scope>test</scope>
170152
</dependency>
171153
</dependencies>
154+
155+
<!--
156+
Integration tests in this module (RegressionIT) require a live
157+
OpenNMS+ALEC instance to talk to. They are intentionally NOT bound
158+
to the default verify lifecycle so a normal CI pipeline does not
159+
try to run them. To run them locally:
160+
161+
mvn -pl demo -am verify -Pdemo-it \
162+
-Dopennms.url=http://localhost:8980/opennms \
163+
-Dopennms.username=admin \
164+
-Dopennms.password=admin
165+
-->
166+
<profiles>
167+
<profile>
168+
<id>demo-it</id>
169+
<build>
170+
<plugins>
171+
<plugin>
172+
<groupId>org.apache.maven.plugins</groupId>
173+
<artifactId>maven-failsafe-plugin</artifactId>
174+
<configuration>
175+
<systemPropertyVariables>
176+
<opennms.url>${opennms.url}</opennms.url>
177+
<opennms.username>${opennms.username}</opennms.username>
178+
<opennms.password>${opennms.password}</opennms.password>
179+
</systemPropertyVariables>
180+
</configuration>
181+
<executions>
182+
<execution>
183+
<goals>
184+
<goal>integration-test</goal>
185+
<goal>verify</goal>
186+
</goals>
187+
</execution>
188+
</executions>
189+
</plugin>
190+
</plugins>
191+
</build>
192+
</profile>
193+
</profiles>
172194
</project>

0 commit comments

Comments
 (0)