Skip to content

Commit 0b37520

Browse files
committed
Fix issue where tests were being skipped in CI.
Because we have @before* methods on CCMTestsSupport, any test class extending this class that had a @CassandraVersion annotation which causes tests to be skipped for that class would also cause subsequent tests to be skipped, even if they lacked the @CassandraVersion annotation. This happens because TestNG takes the declaring Class of the method being skipped instead of the Class implementation being evaluated. To bypass this, setting configfailurepolicy to true causes TestNG to evaluate the class implementation instead of the declaring class of the @Before-annotated method. Also simplifies build by declaring profiles in parent pom, and use test.groups property for declaring test groups. Version mapper tests based on features used. (UDTs, Named params)
1 parent 4497a7f commit 0b37520

File tree

7 files changed

+76
-278
lines changed

7 files changed

+76
-278
lines changed

driver-core/pom.xml

Lines changed: 0 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -304,66 +304,6 @@
304304
</build>
305305

306306
<profiles>
307-
<profile>
308-
<id>default</id>
309-
<properties>
310-
<env>default</env>
311-
</properties>
312-
<activation>
313-
<activeByDefault>true</activeByDefault>
314-
</activation>
315-
<build>
316-
<plugins>
317-
<plugin>
318-
<groupId>org.apache.maven.plugins</groupId>
319-
<artifactId>maven-surefire-plugin</artifactId>
320-
<version>2.16</version>
321-
<configuration>
322-
<groups>unit</groups>
323-
<useFile>false</useFile>
324-
<systemPropertyVariables>
325-
<cassandra.version>${cassandra.version}</cassandra.version>
326-
<ipprefix>${ipprefix}</ipprefix>
327-
<com.datastax.driver.NEW_NODE_DELAY_SECONDS>60</com.datastax.driver.NEW_NODE_DELAY_SECONDS>
328-
</systemPropertyVariables>
329-
<classpathDependencyExcludes>
330-
<classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
331-
</classpathDependencyExcludes>
332-
<!--May be needed for debugging-->
333-
<!--<forkMode>never</forkMode>-->
334-
</configuration>
335-
</plugin>
336-
</plugins>
337-
</build>
338-
</profile>
339-
340-
<profile>
341-
<id>short</id>
342-
<properties>
343-
<env>default</env>
344-
</properties>
345-
<build>
346-
<plugins>
347-
<plugin>
348-
<groupId>org.apache.maven.plugins</groupId>
349-
<artifactId>maven-surefire-plugin</artifactId>
350-
<version>2.16</version>
351-
<configuration>
352-
<groups>unit,short</groups>
353-
<useFile>false</useFile>
354-
<systemPropertyVariables>
355-
<cassandra.version>${cassandra.version}</cassandra.version>
356-
<ipprefix>${ipprefix}</ipprefix>
357-
</systemPropertyVariables>
358-
<classpathDependencyExcludes>
359-
<classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
360-
</classpathDependencyExcludes>
361-
</configuration>
362-
</plugin>
363-
</plugins>
364-
</build>
365-
</profile>
366-
367307
<profile>
368308
<id>isolated</id>
369309
<properties>
@@ -387,87 +327,6 @@
387327
</plugins>
388328
</build>
389329
</profile>
390-
391-
<profile>
392-
<id>long</id>
393-
<properties>
394-
<env>default</env>
395-
</properties>
396-
<build>
397-
<plugins>
398-
<plugin>
399-
<groupId>org.apache.maven.plugins</groupId>
400-
<artifactId>maven-surefire-plugin</artifactId>
401-
<version>2.16</version>
402-
<configuration>
403-
<groups>unit,short,long</groups>
404-
<useFile>false</useFile>
405-
<systemPropertyVariables>
406-
<cassandra.version>${cassandra.version}</cassandra.version>
407-
<ipprefix>${ipprefix}</ipprefix>
408-
</systemPropertyVariables>
409-
<classpathDependencyExcludes>
410-
<classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
411-
</classpathDependencyExcludes>
412-
</configuration>
413-
</plugin>
414-
</plugins>
415-
</build>
416-
</profile>
417-
418-
<profile>
419-
<id>duration</id>
420-
<properties>
421-
<env>default</env>
422-
</properties>
423-
<build>
424-
<plugins>
425-
<plugin>
426-
<groupId>org.apache.maven.plugins</groupId>
427-
<artifactId>maven-surefire-plugin</artifactId>
428-
<version>2.16</version>
429-
<configuration>
430-
<groups>unit,short,long,duration</groups>
431-
<useFile>false</useFile>
432-
<systemPropertyVariables>
433-
<cassandra.version>${cassandra.version}</cassandra.version>
434-
<ipprefix>${ipprefix}</ipprefix>
435-
</systemPropertyVariables>
436-
<classpathDependencyExcludes>
437-
<classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
438-
</classpathDependencyExcludes>
439-
</configuration>
440-
</plugin>
441-
</plugins>
442-
</build>
443-
</profile>
444-
445-
<profile>
446-
<id>doc</id>
447-
<properties>
448-
<env>default</env>
449-
</properties>
450-
<build>
451-
<plugins>
452-
<plugin>
453-
<groupId>org.apache.maven.plugins</groupId>
454-
<artifactId>maven-surefire-plugin</artifactId>
455-
<version>2.16</version>
456-
<configuration>
457-
<groups>unit,doc</groups>
458-
<useFile>false</useFile>
459-
<systemPropertyVariables>
460-
<cassandra.version>${cassandra.version}</cassandra.version>
461-
<ipprefix>${ipprefix}</ipprefix>
462-
</systemPropertyVariables>
463-
<classpathDependencyExcludes>
464-
<classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes>
465-
</classpathDependencyExcludes>
466-
</configuration>
467-
</plugin>
468-
</plugins>
469-
</build>
470-
</profile>
471330
</profiles>
472331

473332
<licenses>

driver-examples/osgi/pom.xml

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,6 @@
193193
</activation>
194194
<build>
195195
<plugins>
196-
<plugin>
197-
<groupId>org.apache.maven.plugins</groupId>
198-
<artifactId>maven-surefire-plugin</artifactId>
199-
<version>2.14</version>
200-
<configuration>
201-
</configuration>
202-
</plugin>
203196
<plugin>
204197
<groupId>org.apache.maven.plugins</groupId>
205198
<artifactId>maven-failsafe-plugin</artifactId>
@@ -222,30 +215,14 @@
222215

223216
<profile>
224217
<id>short</id>
225-
<properties>
226-
<env>default</env>
227-
</properties>
228218
<build>
229219
<plugins>
230-
<plugin>
231-
<groupId>org.apache.maven.plugins</groupId>
232-
<artifactId>maven-surefire-plugin</artifactId>
233-
<version>2.14</version>
234-
<configuration>
235-
<groups>unit,short</groups>
236-
<useFile>false</useFile>
237-
<systemPropertyVariables>
238-
<cassandra.version>${cassandra.version}</cassandra.version>
239-
<ipprefix>${ipprefix}</ipprefix>
240-
</systemPropertyVariables>
241-
</configuration>
242-
</plugin>
243220
<plugin>
244221
<groupId>org.apache.maven.plugins</groupId>
245222
<artifactId>maven-failsafe-plugin</artifactId>
246223
<version>2.18.1</version>
247224
<configuration>
248-
<groups>unit,short</groups>
225+
<groups>${test.groups}</groups>
249226
<useFile>false</useFile>
250227
<systemPropertyVariables>
251228
<cassandra.version>${cassandra.version}</cassandra.version>
@@ -259,30 +236,14 @@
259236

260237
<profile>
261238
<id>long</id>
262-
<properties>
263-
<env>default</env>
264-
</properties>
265239
<build>
266240
<plugins>
267-
<plugin>
268-
<groupId>org.apache.maven.plugins</groupId>
269-
<artifactId>maven-surefire-plugin</artifactId>
270-
<version>2.16</version>
271-
<configuration>
272-
<groups>unit,short,long</groups>
273-
<useFile>false</useFile>
274-
<systemPropertyVariables>
275-
<cassandra.version>${cassandra.version}</cassandra.version>
276-
<ipprefix>${ipprefix}</ipprefix>
277-
</systemPropertyVariables>
278-
</configuration>
279-
</plugin>
280241
<plugin>
281242
<groupId>org.apache.maven.plugins</groupId>
282243
<artifactId>maven-failsafe-plugin</artifactId>
283244
<version>2.18.1</version>
284245
<configuration>
285-
<groups>unit,short,long</groups>
246+
<groups>${test.groups}</groups>
286247
<useFile>false</useFile>
287248
<systemPropertyVariables>
288249
<cassandra.version>${cassandra.version}</cassandra.version>

driver-mapping/pom.xml

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -126,93 +126,6 @@
126126
</plugin>
127127
</plugins>
128128
</build>
129-
130-
<profiles>
131-
<profile>
132-
<id>default</id>
133-
<properties>
134-
<env>default</env>
135-
</properties>
136-
<activation>
137-
<activeByDefault>true</activeByDefault>
138-
</activation>
139-
<build>
140-
<plugins>
141-
<plugin>
142-
<groupId>org.apache.maven.plugins</groupId>
143-
<artifactId>maven-surefire-plugin</artifactId>
144-
<version>2.14</version>
145-
<configuration>
146-
<groups>unit</groups>
147-
<useFile>false</useFile>
148-
<systemPropertyVariables>
149-
<cassandra.version>${cassandra.version}</cassandra.version>
150-
<ipprefix>${ipprefix}</ipprefix>
151-
</systemPropertyVariables>
152-
</configuration>
153-
</plugin>
154-
<plugin>
155-
<artifactId>maven-compiler-plugin</artifactId>
156-
<configuration>
157-
<compilerArgument>-Xlint:all</compilerArgument>
158-
<showWarnings>true</showWarnings>
159-
<showDeprecation>true</showDeprecation>
160-
</configuration>
161-
</plugin>
162-
</plugins>
163-
</build>
164-
</profile>
165-
166-
<profile>
167-
<id>short</id>
168-
<properties>
169-
<env>default</env>
170-
</properties>
171-
<build>
172-
<plugins>
173-
<plugin>
174-
<groupId>org.apache.maven.plugins</groupId>
175-
<artifactId>maven-surefire-plugin</artifactId>
176-
<version>2.14</version>
177-
<configuration>
178-
<groups>unit,short</groups>
179-
<useFile>false</useFile>
180-
<systemPropertyVariables>
181-
<cassandra.version>${cassandra.version}</cassandra.version>
182-
<ipprefix>${ipprefix}</ipprefix>
183-
</systemPropertyVariables>
184-
</configuration>
185-
</plugin>
186-
</plugins>
187-
</build>
188-
</profile>
189-
190-
<profile>
191-
<id>long</id>
192-
<properties>
193-
<env>default</env>
194-
</properties>
195-
<build>
196-
<plugins>
197-
<plugin>
198-
<groupId>org.apache.maven.plugins</groupId>
199-
<artifactId>maven-surefire-plugin</artifactId>
200-
<version>2.14</version>
201-
<configuration>
202-
<groups>unit,short,long</groups>
203-
<useFile>false</useFile>
204-
<systemPropertyVariables>
205-
<cassandra.version>${cassandra.version}</cassandra.version>
206-
<ipprefix>${ipprefix}</ipprefix>
207-
</systemPropertyVariables>
208-
</configuration>
209-
</plugin>
210-
</plugins>
211-
</build>
212-
</profile>
213-
214-
</profiles>
215-
216129
<licenses>
217130
<license>
218131
<name>Apache 2</name>

driver-mapping/src/test/java/com/datastax/driver/mapping/MapperTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ public void should_not_initialize_session_when_protocol_version_provided() {
468468
* @test_category object_mapper
469469
*/
470470
@Test(groups = "short")
471+
@CassandraVersion(major = 2.0)
471472
public void should_flag_statement_as_idempotent() {
472473
MappingManager manager = new MappingManager(session());
473474
PostAccessor post = manager.createAccessor(PostAccessor.class);
@@ -484,6 +485,7 @@ public void should_flag_statement_as_idempotent() {
484485
* @test_category object_mapper
485486
*/
486487
@Test(groups = "short")
488+
@CassandraVersion(major = 2.0)
487489
public void should_flag_statement_as_non_idempotent() {
488490
MappingManager manager = new MappingManager(session());
489491
PostAccessor post = manager.createAccessor(PostAccessor.class);
@@ -500,6 +502,7 @@ public void should_flag_statement_as_non_idempotent() {
500502
* @test_category object_mapper
501503
*/
502504
@Test(groups = "short")
505+
@CassandraVersion(major = 2.0)
503506
public void should_flag_statement_with_null_idempotence() {
504507
MappingManager manager = new MappingManager(session());
505508
PostAccessor post = manager.createAccessor(PostAccessor.class);
@@ -515,6 +518,7 @@ public void should_flag_statement_with_null_idempotence() {
515518
* @test_category object_mapper
516519
*/
517520
@Test(groups = "short")
521+
@CassandraVersion(major = 2.0)
518522
public void should_flag_all_mapper_generated_statements_as_idempotent() {
519523
MappingManager manager = new MappingManager(session());
520524
Mapper<User> mapper = manager.mapper(User.class);

driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTCollectionsTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.datastax.driver.mapping;
1717

1818
import com.datastax.driver.core.CCMTestsSupport;
19+
import com.datastax.driver.core.utils.CassandraVersion;
1920
import com.datastax.driver.mapping.annotations.*;
2021
import com.google.common.base.Objects;
2122
import com.google.common.collect.ImmutableMap;
@@ -33,6 +34,7 @@
3334
* Tests mapping of collections of UDTs.
3435
*/
3536
@SuppressWarnings("unused")
37+
@CassandraVersion(major = 2.1)
3638
public class MapperUDTCollectionsTest extends CCMTestsSupport {
3739

3840
@Override

driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import com.datastax.driver.core.CCMTestsSupport;
1919
import com.datastax.driver.core.ResultSet;
20+
import com.datastax.driver.core.utils.CassandraVersion;
2021
import com.datastax.driver.mapping.annotations.*;
2122
import com.google.common.base.Objects;
2223
import com.google.common.collect.Maps;
@@ -29,6 +30,7 @@
2930
import static org.testng.Assert.*;
3031

3132
@SuppressWarnings("unused")
33+
@CassandraVersion(major = 2.1)
3234
public class MapperUDTTest extends CCMTestsSupport {
3335

3436
@Override

0 commit comments

Comments
 (0)