Skip to content

Commit

Permalink
more test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Roukoswarf committed Oct 24, 2023
1 parent 99d13a5 commit 3b67506
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dist: jammy
language: go

go:
- 1.20
- 1.21

go_import_path: github.com/tidepool-org/platform

Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,16 @@ test-watch: ginkgo
@cd $(ROOT_DIRECTORY) && . ./env.test.sh && ginkgo watch --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r $(TEST)

ci-test: ginkgo
@echo "ginkgo --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r -randomizeSuites -randomizeAllSpecs -succinct -failOnPending -cover -trace -race -progress -keepGoing $(TEST)"
@cd $(ROOT_DIRECTORY) && . ./env.test.sh && ginkgo --require-suite --poll-progress-after=10s --poll-progress-interval=20s --compilers=2 -r -randomizeSuites -randomizeAllSpecs -succinct -failOnPending -cover -trace -race -progress -keepGoing $(TEST)
@echo "ginkgo --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r --randomize-suites --randomize-all --succinct --fail-on-pending --cover --trace --race --keep-going $(TEST)"
@cd $(ROOT_DIRECTORY) && . ./env.test.sh && ginkgo --require-suite --poll-progress-after=10s --poll-progress-interval=20s --compilers=2 -r --randomize-suites --randomize-all --succinct --fail-on-pending --cover --trace --race --keep-going $(TEST)

ci-test-until-failure: ginkgo
@echo "ginkgo --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r -randomizeSuites -randomizeAllSpecs -succinct -failOnPending -cover -trace -race -progress -keepGoing -untilItFails $(TEST)"
@cd $(ROOT_DIRECTORY) && . ./env.test.sh && ginkgo --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r -randomizeSuites -randomizeAllSpecs -succinct -failOnPending -cover -trace -race -progress -keepGoing -untilItFails $(TEST)
@echo "ginkgo --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r --randomize-suites --randomize-all --succinct --fail-on-pending --cover --trace --race --keep-going -untilItFails $(TEST)"
@cd $(ROOT_DIRECTORY) && . ./env.test.sh && ginkgo --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r --randomize-suites --randomize-all --succinct --fail-on-pending --cover --trace --race --keep-going -untilItFails $(TEST)

ci-test-watch: ginkgo
@echo "ginkgo watch --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r -randomizeAllSpecs -succinct -failOnPending -cover -trace -race -progress $(TEST)"
@cd $(ROOT_DIRECTORY) && . ./env.test.sh && ginkgo watch --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r -randomizeAllSpecs -succinct -failOnPending -cover -trace -race -progress $(TEST)
@echo "ginkgo watch --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r --randomize-all --succinct --fail-on-pending --cover --trace --race $(TEST)"
@cd $(ROOT_DIRECTORY) && . ./env.test.sh && ginkgo watch --require-suite --poll-progress-after=10s --poll-progress-interval=20s -r --randomize-all --succinct --fail-on-pending --cover --trace --race $(TEST)

deploy: clean-deploy deploy-services deploy-migrations deploy-tools

Expand Down
8 changes: 5 additions & 3 deletions data/summary/store/store_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package store_test
import (
"testing"

"github.com/tidepool-org/platform/test"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

func TestSuite(t *testing.T) {
test.Test(t)
func TestSummaryStore(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Summary Store Suite")
}
13 changes: 13 additions & 0 deletions data/summary/summary_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package summary_test

import (
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

func TestSummary(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Summary Suite")
}
7 changes: 5 additions & 2 deletions data/summary/types/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ func (s *Summary[T, A]) SetOutdated(reason string) {

s.Dates.LastUpdatedReason = nil
s.Dates.OutdatedReason = set.ToSlice()
s.Dates.OutdatedSince = pointer.FromAny(time.Now().Add(setOutdatedBuffer).UTC().Truncate(time.Millisecond))
s.Dates.HasOutdatedSince = true

if s.Dates.OutdatedSince == nil {
s.Dates.OutdatedSince = pointer.FromAny(time.Now().Add(setOutdatedBuffer).UTC().Truncate(time.Millisecond))
s.Dates.HasOutdatedSince = true
}
}

func NewDates() Dates {
Expand Down
2 changes: 1 addition & 1 deletion task/queue/multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ var _ = Describe("multi queue", func() {
multi.Start()

// Wait until completion (up to 10 seconds)
tCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
tCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
ticker := time.NewTicker(200 * time.Millisecond)
wg := &sync.WaitGroup{}
wg.Add(1)
Expand Down

0 comments on commit 3b67506

Please sign in to comment.