Skip to content

Commit

Permalink
NussknackerVersion parsing fix after semver bump
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadius committed Sep 26, 2024
1 parent 9048b0f commit 06ce4a0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ trait ComponentProvider {

object NussknackerVersion {

val current: NussknackerVersion = NussknackerVersion(new Semver(BuildInfo.version))
val current: NussknackerVersion = parse(BuildInfo.version)

def parse(versionString: String): NussknackerVersion = {
NussknackerVersion(Semver.coerce(versionString))
}

}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package pl.touk.nussknacker.engine.api.component

import org.scalatest.funsuite.AnyFunSuiteLike
import org.scalatest.matchers.should.Matchers
import scala.jdk.CollectionConverters._

class NussknackerVersionTest extends AnyFunSuiteLike with Matchers {

test("should allow to use underscores in nussknacker version") {
val version =
NussknackerVersion.parse("1.18.0-preview_testing-mechanism-iceberg-fix-2024-09-26-20745-9048b0f0a-SNAPSHOT")
version.value.getMajor shouldBe 1
version.value.getMinor shouldBe 18
version.value.getPatch shouldBe 0
version.value.getPreRelease.asScala shouldBe empty
version.value.getBuild.asScala shouldBe empty
}

}

0 comments on commit 06ce4a0

Please sign in to comment.