diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ef15743..f72cf25 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -25,4 +25,4 @@ jobs: run: make build - name: Test - run: go test -v ./... + run: make test diff --git a/Makefile b/Makefile index 8c9e222..4209eb3 100644 --- a/Makefile +++ b/Makefile @@ -24,3 +24,6 @@ build: clean: rm -rf ${BUILD_DIR} go clean + +test: + go test -tags=unit -timeout=600s -v ./... diff --git a/internal/utils/utils_test.go b/internal/utils/utils_test.go new file mode 100644 index 0000000..e09778e --- /dev/null +++ b/internal/utils/utils_test.go @@ -0,0 +1,18 @@ +// +build unit + +package utils + +import ( + "testing" + "time" +) + +func TestGetSQLiteFormattedDateTime(t *testing.T) { + datetime := time.Date(2021, time.Month(1), 01, 1, 30, 15, 0, time.UTC) + result := GetSQLiteFormattedDateTime(datetime) + + if result != "2021-01-01 01:30:15" { + t.Log("Expected 2021-01-01 01:30:15 but got ", result) + t.Fail() + } +}