Skip to content

Commit

Permalink
[PS] Fixed an issue where directory naming was preventing some test r…
Browse files Browse the repository at this point in the history
…esources getting added to source control
  • Loading branch information
beyond-code-github committed Jan 4, 2017
1 parent 3d8f364 commit 1945038
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 12 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>uk.gov.hmrc</groupId>
<artifactId>time_2.11</artifactId>
<packaging>jar</packaging>
<description>time</description>
<version>1.3.0-1-g21312cc</version>
<licenses>
<license>
<name>Apache-2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<name>time</name>
<organization>
<name>uk.gov.hmrc</name>
</organization>
<url>https://www.gov.uk/government/organisations/hm-revenue-customs</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<scm>
<connection>scm:git@github.com:hmrc/time.git</connection>
<developerConnection>scm:git@github.com:hmrc/time.git</developerConnection>
<url>git@github.com:hmrc/time.git</url>
</scm>
<developers>
<developer>
<id>duncancrawford</id>
<name>Duncan Crawford</name>
<url>http://www.equalexperts.com</url>
</developer>
<developer>
<id>xnejp03</id>
<name>Petr Nejedly</name>
<url>http://www.equalexperts.com</url>
</developer>
<developer>
<id>alvarovilaplana</id>
<name>Alvaro Vilaplana</name>
<url>http://www.equalexperts.com</url>
</developer>
<developer>
<id>jakobgrunig</id>
<name>Jakob Grunig</name>
<url>http://www.equalexperts.com</url>
</developer>
<developer>
<id>vaughansharman</id>
<name>Vaughan Sharman</name>
<url>http://www.equalexperts.com</url>
</developer>
<developer>
<id>davesammut</id>
<name>Dave Sammut</name>
<url>http://www.equalexperts.com</url>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.11.6</version>
</dependency>
<dependency>
<groupId>com.github.nscala-time</groupId>
<artifactId>nscala-time_2.11</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.11</artifactId>
<version>2.2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.pegdown</groupId>
<artifactId>pegdown</artifactId>
<version>1.5.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>typesafereleases</id>
<name>typesafe-releases</name>
<url>http://repo.typesafe.com/typesafe/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>sonatypereleases</id>
<name>sonatype-releases</name>
<url>https://oss.sonatype.org/content/repositories/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>bintrayhmrcreleases</id>
<name>bintray-hmrc-releases</name>
<url>https://dl.bintray.com/hmrc/releases/</url>
<layout>default</layout>
</repository>
</repositories>
</project>
24 changes: 12 additions & 12 deletions src/test/scala/uk/gov/hmrc/releaser/CoordinatorSpecs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ class CoordinatorSpecs extends WordSpec with Matchers with OptionValues with Try

"the coordinator" should {

"release version 1.3.1 of a library with an assembly, not modifying the assembly manifest, when given the inputs 'lib', '1.3.0-1-g21312cc' and 'hotfix' as the artefact, release candidate and release type" in {
"release version 1.3.1 of a library with an assembly, not modifying the assembly manifest, when given the inputs 'libr', '1.3.0-1-g21312cc' and 'hotfix' as the artefact, release candidate and release type" in {

val metaDataProvider = mock[MetaDataProvider]
when(metaDataProvider.fromJarFile(any())).thenReturn(Success(ArtefactMetaData("sha", "author", DateTime.now())))

val root = "uk/gov/hmrc/lib_2.11/1.3.0-1-g21312cc"
val root = "uk/gov/hmrc/libr_2.11/1.3.0-1-g21312cc"
val fakeRepoConnector = new FakeBintrayRepoConnector(
"/lib/",
jarResource = Some(s"$root/lib_2.11-1.3.0-1-g21312cc.jar"),
bintrayFiles = Set(s"$root/lib_2.11-1.3.0-1-g21312cc.pom", s"$root/lib_2.11-1.3.0-1-g21312cc-assembly.jar"))
"/libr/",
jarResource = Some(s"$root/libr_2.11-1.3.0-1-g21312cc.jar"),
bintrayFiles = Set(s"$root/libr_2.11-1.3.0-1-g21312cc.pom", s"$root/libr_2.11-1.3.0-1-g21312cc-assembly.jar"))

val coordinator = new Coordinator(tempDir(), metaDataProvider, new FakeGithubTagAndRelease, fakeRepoConnector)
coordinator.start("lib", Repo("lib"), ReleaseCandidateVersion("1.3.0-1-g21312cc"), ReleaseType.HOTFIX) match {
coordinator.start("libr", Repo("libr"), ReleaseCandidateVersion("1.3.0-1-g21312cc"), ReleaseType.HOTFIX) match {
case Failure(e) =>
log.error(s"Test failed with: ${e.getMessage} - ${e.toString}")
fail(e)
Expand All @@ -68,15 +68,15 @@ class CoordinatorSpecs extends WordSpec with Matchers with OptionValues with Try

fakeRepoConnector.downloadedFiles.size shouldBe 3
fakeRepoConnector.downloadedFiles should contain allOf(
"https://bintray.com/artifact/download/hmrc/release-candidates/uk/gov/hmrc/lib_2.11/1.3.0-1-g21312cc/lib_2.11-1.3.0-1-g21312cc.pom",
"https://bintray.com/artifact/download/hmrc/release-candidates/uk/gov/hmrc/lib_2.11/1.3.0-1-g21312cc/lib_2.11-1.3.0-1-g21312cc-assembly.jar",
"https://bintray.com/artifact/download/hmrc/release-candidates/uk/gov/hmrc/lib_2.11/1.3.0-1-g21312cc/lib_2.11-1.3.0-1-g21312cc.jar")
"https://bintray.com/artifact/download/hmrc/release-candidates/uk/gov/hmrc/libr_2.11/1.3.0-1-g21312cc/libr_2.11-1.3.0-1-g21312cc.pom",
"https://bintray.com/artifact/download/hmrc/release-candidates/uk/gov/hmrc/libr_2.11/1.3.0-1-g21312cc/libr_2.11-1.3.0-1-g21312cc-assembly.jar",
"https://bintray.com/artifact/download/hmrc/release-candidates/uk/gov/hmrc/libr_2.11/1.3.0-1-g21312cc/libr_2.11-1.3.0-1-g21312cc.jar")

fakeRepoConnector.uploadedFiles.size shouldBe 3
fakeRepoConnector.uploadedFiles.map { case (_,_,url) => url } should contain allOf(
"https://bintray.com/api/v1/maven/hmrc/releases/lib/uk/gov/hmrc/lib_2.11/1.3.1/lib_2.11-1.3.1.pom",
"https://bintray.com/api/v1/maven/hmrc/releases/lib/uk/gov/hmrc/lib_2.11/1.3.1/lib_2.11-1.3.1-assembly.jar",
"https://bintray.com/api/v1/maven/hmrc/releases/lib/uk/gov/hmrc/lib_2.11/1.3.1/lib_2.11-1.3.1.jar")
"https://bintray.com/api/v1/maven/hmrc/releases/libr/uk/gov/hmrc/libr_2.11/1.3.1/libr_2.11-1.3.1.pom",
"https://bintray.com/api/v1/maven/hmrc/releases/libr/uk/gov/hmrc/libr_2.11/1.3.1/libr_2.11-1.3.1-assembly.jar",
"https://bintray.com/api/v1/maven/hmrc/releases/libr/uk/gov/hmrc/libr_2.11/1.3.1/libr_2.11-1.3.1.jar")

val Some((pomVersion, pomFile, _)) = fakeRepoConnector.uploadedFiles.find(_._2.toString.endsWith(".pom"))
val Some((jarVersion, jarFile, _)) = fakeRepoConnector.uploadedFiles.find(_._2.toString.endsWith("1.3.1.jar"))
Expand Down

0 comments on commit 1945038

Please sign in to comment.