--- /dev/null
+This test checks that version bump order is maintained:
+
+1) bump date-based versions
+2) bump -SNAPSHOT versions
+3) bump -RELEASE versions
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.linuxfoundation.releng</groupId>
+ <artifactId>test-artifact</artifactId>
+ <version>1.0.0-TestRelease</version>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ <version>2013.09.07.10-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>general-entity</artifactId>
+ <version>0.10.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.linuxfoundation.releng</groupId>
+ <artifactId>test-artifact</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ <version>2013.09.07.11.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>general-entity</artifactId>
+ <version>0.11.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
--- /dev/null
+This test checks that a release artifact is version bumped by
+x.y.(z+1)-SNAPSHOT when version bump is performed.
--- /dev/null
+This test checks that a SNAPSHOT artifact is properly bumped by
+x.(y+1).z-SNAPSHOT when version bump is run.
--- /dev/null
+This test checks that SNAPSHOT artifacts properly get converted to a
+RELEASE_TAG as passed in by the user.
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.linuxfoundation.releng</groupId>
+ <artifactId>test-artifact</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.linuxfoundation.releng</groupId>
+ <artifactId>test-artifact</artifactId>
+ <version>1.0.0-TestRelease</version>
+</project>
@pytest.mark.datafiles(
- os.path.join(FIXTURE_DIR, 'pom.xml'),
- os.path.join(FIXTURE_DIR, 'pom.xml.expected-bump'),
+ os.path.join(FIXTURE_DIR, 'version_bump'),
)
def test_version_bump(cli_runner, datafiles):
os.chdir(datafiles)
-
- # Version bump should bump versions by x.(y+1).z
result = cli_runner.invoke(cli.cli, ['version', 'bump', 'TestRelease'])
- assert filecmp.cmp('pom.xml', 'pom.xml.expected-bump')
+
+ for _file in datafiles.listdir():
+ pom = str(_file) + '/pom.xml'
+ expected_pom = str(_file) + '/pom.xml.expected'
+ assert filecmp.cmp(pom, expected_pom)
@pytest.mark.datafiles(
- os.path.join(FIXTURE_DIR, 'pom.xml'),
- os.path.join(FIXTURE_DIR, 'pom.xml.expected-release'),
- os.path.join(FIXTURE_DIR, 'pom.xml.expected-release-bump'),
+ os.path.join(FIXTURE_DIR, 'version_release'),
)
def test_version_release(cli_runner, datafiles):
os.chdir(datafiles)
-
- # Version release should modify SNAPSHOT to TestRelease
result = cli_runner.invoke(cli.cli, ['version', 'release', 'TestRelease'])
- assert filecmp.cmp('pom.xml', 'pom.xml.expected-release')
- # Post release bump should bump versions by x.y.(z+1) and revert back to SNAPSHOT
- result = cli_runner.invoke(cli.cli, ['version', 'bump', 'TestRelease'])
- assert filecmp.cmp('pom.xml', 'pom.xml.expected-release-bump')
+ for _file in datafiles.listdir():
+ pom = str(_file) + '/pom.xml'
+ expected_pom = str(_file) + '/pom.xml.expected'
+ assert filecmp.cmp(pom, expected_pom)