diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9f2ef1f --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +LDFLAGS?=--ldflags '-extldflags "-static"' --ldflags="-X 'main.commit=$(shell git rev-parse HEAD)' -X 'main.version=$(shell git describe --tags)' -X 'main.date=$(shell date '+%Y-%m-%d %T.%s%z')'" +export CGO_ENABLED=0 + +build-run: + docker run -v $(shell pwd):/code -w /code -it registry.cv.mazarbul.net/declarative/build-golang:1.22.1-alpine-x86_64 sh +test: + go test -coverprofile=artifacts/coverage.profile ./... + go tool cover -html=artifacts/coverage.profile -o artifacts/code-coverage.html diff --git a/fixture/fixture_test.go b/fixture/fixture_test.go index 795bf3c..81730c4 100644 --- a/fixture/fixture_test.go +++ b/fixture/fixture_test.go @@ -1,10 +1,11 @@ // Copyright 2024 Matthew Rich . All rights reserved. + package fixture_test import ( "testing" "math" - "gitea.cv.mazarbul.net/rosskeen.house/testing/fixture" + "testing/fixture" ) func Fixture2Pow(p fixture.Param) interface{} { diff --git a/md/mockdata.go b/md/mockdata.go index f126c71..051b74e 100644 --- a/md/mockdata.go +++ b/md/mockdata.go @@ -1,4 +1,5 @@ // Copyright 2024 Matthew Rich . All rights reserved. + package mockdata import ( @@ -9,7 +10,7 @@ import ( // "fmt" // "strings" // "strconv" - "gitea.cv.mazarbul.net/rosskeen.house/testing/fixture" + "testing/fixture" ) // Raw file fixture data diff --git a/md/mockdata_test.go b/md/mockdata_test.go index 99acc0c..5b2edc1 100644 --- a/md/mockdata_test.go +++ b/md/mockdata_test.go @@ -1,10 +1,11 @@ // Copyright 2024 Matthew Rich . All rights reserved. + package mockdata_test import ( "testing" - "gitea.cv.mazarbul.net/rosskeen.house/testing/fixture" - "gitea.cv.mazarbul.net/rosskeen.house/testing/md" + "testing/fixture" + "testing/md" ) type MockDataTest struct { diff --git a/md/params.go b/md/params.go index 09e3e4f..61454cc 100644 --- a/md/params.go +++ b/md/params.go @@ -1,4 +1,5 @@ // Copyright 2024 Matthew Rich . All rights reserved. + package mockdata import ( @@ -7,7 +8,7 @@ import ( "gopkg.in/yaml.v2" "log" "fmt" - "gitea.cv.mazarbul.net/rosskeen.house/testing/fixture" + "testing/fixture" ) // Return a structure to load the mock data into diff --git a/md/results.go b/md/results.go index dd937f4..a874f21 100644 --- a/md/results.go +++ b/md/results.go @@ -1,11 +1,12 @@ // Copyright 2024 Matthew Rich . All rights reserved. + package mockdata import ( "path/filepath" "log" "fmt" - "gitea.cv.mazarbul.net/rosskeen.house/testing/fixture" + "testing/fixture" ) type Results struct { diff --git a/td/params.go b/td/params.go index 0ebe474..a1944a3 100644 --- a/td/params.go +++ b/td/params.go @@ -1,4 +1,5 @@ // Copyright 2024 Matthew Rich . All rights reserved. + package testdata import ( @@ -6,7 +7,7 @@ import ( "path/filepath" "log" "fmt" - "gitea.cv.mazarbul.net/rosskeen.house/testing/fixture" + "testing/fixture" ) diff --git a/td/results.go b/td/results.go index 7611854..728c76b 100644 --- a/td/results.go +++ b/td/results.go @@ -1,11 +1,12 @@ // Copyright 2024 Matthew Rich . All rights reserved. + package testdata import ( "path/filepath" "log" "fmt" - "gitea.cv.mazarbul.net/rosskeen.house/testing/fixture" + "testing/fixture" ) type TypeConversion func(value interface{}) interface{} diff --git a/td/testdata.go b/td/testdata.go index 8af93c2..1ec6bfb 100644 --- a/td/testdata.go +++ b/td/testdata.go @@ -1,4 +1,5 @@ // Copyright 2024 Matthew Rich . All rights reserved. + package testdata import ( @@ -9,7 +10,7 @@ import ( // "fmt" // "strings" // "strconv" - "gitea.cv.mazarbul.net/rosskeen.house/testing/fixture" + "testing/fixture" ) // Raw file fixture data diff --git a/td/testdata_test.go b/td/testdata_test.go index 5b20c80..0e9c688 100644 --- a/td/testdata_test.go +++ b/td/testdata_test.go @@ -1,12 +1,13 @@ // Copyright 2024 Matthew Rich . All rights reserved. + package testdata_test import ( "testing" "strconv" "strings" - "gitea.cv.mazarbul.net/rosskeen.house/testing/fixture" - "gitea.cv.mazarbul.net/rosskeen.house/testing/td" + "testing/fixture" + "testing/td" ) func TestTDFixture(t *testing.T) {