diff --git a/Makefile b/Makefile index 13e332d..48338f7 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ else - DEL /F /Q cover output endif -run = . +run = . # count says how many times to run the tests. count = 1 @@ -85,7 +85,7 @@ ifneq ("$(OS)","Windows_NT") endif # Define docker container name our test MongoDB instance. -MONGO_TEST_CONTAINER_NAME=blocker-mongo-test-db +MONGO_TEST_CONTAINER_NAME=accounts-mongo-test-db # start-mongo starts a local mongoDB container with no persistence. # We first prepare for the start of the container by making sure the test @@ -136,11 +136,6 @@ test-long-ci: @mkdir -p cover GORACE='$(racevars)' go test -race --coverprofile='./cover/cover.out' -v -failfast -tags='testing debug netgo' -timeout=600s $(pkgs) -run=$(run) -count=$(count) -# Cookie vars -# TODO: Are these used? -COOKIE_HASH_KEY="7eb32cfab5014d14394648dae1cf4e606727eee2267f6a50213cd842e61c5bce" -COOKIE_ENC_KEY="65d31d12b80fc57df16d84c02a9bb62e2bc3b633388b05e49ef8abfdf0d35cf3" - # docker-generate is a docker command for env var generation # # The sleep is to allow time for the docker container to start up after `docker diff --git a/api/handlers_test.go b/api/handlers_test.go index f12e28e..5dfe807 100644 --- a/api/handlers_test.go +++ b/api/handlers_test.go @@ -132,7 +132,7 @@ func TestUserLimitsGetFromTier(t *testing.T) { } }() // The call that we expect to log a critical. - _ = userLimitsGetFromTier("", math.MaxInt64, false, true) + _ = userLimitsGetFromTier("", math.MaxInt, false, true) return }() if err != nil { diff --git a/build/debug_off.go b/build/debug_off.go index edd7789..330edcf 100644 --- a/build/debug_off.go +++ b/build/debug_off.go @@ -1,3 +1,4 @@ +//go:build !debug // +build !debug package build diff --git a/build/debug_on.go b/build/debug_on.go index eab6031..1e6f501 100644 --- a/build/debug_on.go +++ b/build/debug_on.go @@ -1,3 +1,4 @@ +//go:build debug // +build debug package build diff --git a/build/release_dev.go b/build/release_dev.go index 69cc259..fda0506 100644 --- a/build/release_dev.go +++ b/build/release_dev.go @@ -1,3 +1,4 @@ +//go:build dev // +build dev package build diff --git a/build/release_standard.go b/build/release_standard.go index 39971c2..7c88a6e 100644 --- a/build/release_standard.go +++ b/build/release_standard.go @@ -1,3 +1,4 @@ +//go:build !testing && !dev // +build !testing,!dev package build diff --git a/build/release_testing.go b/build/release_testing.go index e6aeedf..38943e7 100644 --- a/build/release_testing.go +++ b/build/release_testing.go @@ -1,3 +1,4 @@ +//go:build testing // +build testing package build diff --git a/types/email_test.go b/types/email_test.go index 31933ff..250eb8f 100644 --- a/types/email_test.go +++ b/types/email_test.go @@ -12,7 +12,8 @@ import ( func TestEmail_String(t *testing.T) { s := "mIxEdCaSeStRiNg" e := Email(s) - if !strings.EqualFold(e.String(), s) { + // We want to directly compare the strings in a case-sensitive way. + if e.String() != strings.ToLower(s) { t.Fatalf("Expected '%s', got '%s'", strings.ToLower(s), e) } } @@ -44,7 +45,7 @@ func TestEmail_UnmarshalJSON(t *testing.T) { t.Fatal(err) } // We expect the unmarshalled email to be lowercase only. - if !strings.EqualFold(string(e), string(b[1:len(b)-1])) { + if string(e) != strings.ToLower(string(b[1:len(b)-1])) { t.Fatalf("Expected to get a lowercase version of '%s', i.e. '%s' but got '%s'", e, strings.ToLower(string(e)), e) } }