Merge branch 'main' into storage-module
commit
95d94f0809
|
@ -12,17 +12,17 @@ jobs:
|
|||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ^1.15
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
run: make build
|
||||
|
||||
- name: Test
|
||||
run: go test -v ./...
|
||||
run: make test-with-coverage
|
||||
- uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: coverage.out
|
||||
|
|
6
Makefile
6
Makefile
|
@ -24,3 +24,9 @@ build:
|
|||
clean:
|
||||
rm -rf ${BUILD_DIR}
|
||||
go clean
|
||||
|
||||
test:
|
||||
go test -tags=unit -timeout=600s -v ./...
|
||||
|
||||
test-with-coverage:
|
||||
go test -tags=unit -timeout=600s -v ./... -coverprofile=coverage.out
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
codecov:
|
||||
require_ci_to_pass: no
|
||||
|
||||
comment: false
|
|
@ -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()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue