Skip to content

Commit

Permalink
Merge pull request #2751 from tdonohue/fix_bug_running_individual_tests
Browse files Browse the repository at this point in the history
Fix bug running individual tests on `master`
  • Loading branch information
tdonohue committed May 4, 2020
2 parents e4ab84e + a2ff137 commit 7934736
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 33 deletions.
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,36 +88,33 @@ run automatically by [Travis CI](https://travis-ci.org/DSpace/DSpace/) for all P

* How to run both Unit Tests (via `maven-surefire-plugin`) and Integration Tests (via `maven-failsafe-plugin`):
```
# NOTE: while "mvn test" runs Unit Tests,
# Integration Tests only run for "verify" or "install" phases
mvn clean install -Dmaven.test.skip=false -DskipITs=false
mvn clean test -Dmaven.test.skip=false -DskipITs=false
```
* How to run just Unit Tests:
```
mvn clean test -Dmaven.test.skip=false
mvn test -Dmaven.test.skip=false
```
* How to run a *single* Unit Test
```
# Run all tests in a specific test class
# NOTE: testClassName is just the class name, do not include package
mvn clean test -Dmaven.test.skip=false -Dtest=[testClassName]
# NOTE: failIfNoTests=false is required to skip tests in other modules
mvn test -Dmaven.test.skip=false -Dtest=[full.package.testClassName] -DfailIfNoTests=false
# Run one test method in a specific test class
mvn clean test -Dmaven.test.skip=false -Dtest=[testClassName]#[testMethodName]
mvn test -Dmaven.test.skip=false -Dtest=[full.package.testClassName]#[testMethodName] -DfailIfNoTests=false
```
* How to run Integration Tests (requires running Unit tests too)
* How to run Integration Tests (requires enabling Unit tests too)
```
mvn clean verify -Dmaven.test.skip=false -DskipITs=false
mvn verify -Dmaven.test.skip=false -DskipITs=false
```
* How to run a *single* Integration Test (requires running Unit tests too)
* How to run a *single* Integration Test (requires enabling Unit tests too)
```
# Run all integration tests in a specific test class
# NOTE: Integration Tests only run for "verify" or "install" phases
# NOTE: testClassName is just the class name, do not include package
mvn clean verify -Dmaven.test.skip=false -DskipITs=false -Dit.test=[testClassName]
# NOTE: failIfNoTests=false is required to skip tests in other modules
mvn test -Dmaven.test.skip=false -DskipITs=false -Dtest=[full.package.testClassName] -DfailIfNoTests=false
# Run one test method in a specific test class
mvn clean verify -Dmaven.test.skip=false -DskipITs=false -Dit.test=[testClassName]#[testMethodName]
mvn test -Dmaven.test.skip=false -DskipITs=false -Dtest=[full.package.testClassName]#[testMethodName] -DfailIfNoTests=false
```
* How to run only tests of a specific DSpace module
```
Expand Down
7 changes: 1 addition & 6 deletions dspace/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
</build>
<dependencies>
<!-- Add all modules that should be taken into account for the coverage reports -->
<!-- (Excludes dspace-rest which is deprecated and doesn't build by default) -->
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-api</artifactId>
Expand All @@ -205,12 +206,6 @@
<artifactId>dspace-rdf</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-rest</artifactId>
<classifier>classes</classifier>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-services</artifactId>
Expand Down
30 changes: 17 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,23 @@
<modules>
<module>dspace-rest</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-rest</artifactId>
<version>7.0-beta3-SNAPSHOT</version>
<type>jar</type>
<classifier>classes</classifier>
</dependency>
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-rest</artifactId>
<version>7.0-beta3-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
</dependencyManagement>
</profile>


Expand Down Expand Up @@ -1026,19 +1043,6 @@
<artifactId>dspace-rdf</artifactId>
<version>7.0-beta3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-rest</artifactId>
<version>7.0-beta3-SNAPSHOT</version>
<type>jar</type>
<classifier>classes</classifier>
</dependency>
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-rest</artifactId>
<version>7.0-beta3-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-server-webapp</artifactId>
Expand Down

0 comments on commit 7934736

Please sign in to comment.