mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-16 05:16:08 +02:00
fortify: fix semver for pip (#2104)
This commit is contained in:
parent
b506235398
commit
911a88bd49
@ -13,7 +13,7 @@ const (
|
||||
// SchemeMajorMinorVersion is the versioning scheme based on the major version only
|
||||
SchemeMajorMinorVersion = `{{(split "." (split "-" .Version)._0)._0}}.{{(split "." (split "-" .Version)._0)._1}}`
|
||||
// SchemeSemanticVersion is the versioning scheme based on the major.minor.micro version
|
||||
SchemeSemanticVersion = `{{(split "-" .Version)._0}}`
|
||||
SchemeSemanticVersion = `{{(split "." (split "-" .Version)._0)._0}}.{{(split "." (split "-" .Version)._0)._1}}.{{(split "." (split "-" .Version)._0)._2}}`
|
||||
// SchemeFullVersion is the versioning scheme based on the full version
|
||||
SchemeFullVersion = "{{.Version}}"
|
||||
)
|
||||
|
@ -1,8 +1,9 @@
|
||||
package versioning
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type mavenMock struct {
|
||||
@ -89,4 +90,11 @@ func TestDetermineProjectCoordinates(t *testing.T) {
|
||||
assert.Equal(t, "python-test", name, "Expected different project name")
|
||||
assert.Equal(t, "2", version, "Expected different project version")
|
||||
})
|
||||
|
||||
t.Run("python semantic", func(t *testing.T) {
|
||||
gav, _ := (&pipMock{artifactID: "python-test", version: "2.2.3.20200101"}).GetCoordinates()
|
||||
name, version := DetermineProjectCoordinates(nameTemplate, "semantic", gav)
|
||||
assert.Equal(t, "python-test", name, "Expected different project name")
|
||||
assert.Equal(t, "2.2.3", version, "Expected different project version")
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user