mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-21 20:56:04 +03:00
fix race & prettier test output
This commit is contained in:
parent
90e9de051a
commit
ca47e757bc
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -46,7 +46,9 @@ jobs:
|
|||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: go mod tidy
|
run: go mod tidy
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: go test ./... -v -cpu 2 -timeout 30s -race -cover -coverprofile=coverage.txt -covermode=atomic
|
run: |
|
||||||
|
go install gotest.tools/gotestsum@latest
|
||||||
|
gotestsum --format testdox ./... -v -cpu 2 -timeout 30s -race -cover -coverprofile=coverage.txt -covermode=atomic
|
||||||
- name: Coverage
|
- name: Coverage
|
||||||
run: |
|
run: |
|
||||||
go install github.com/axw/gocov/gocov@latest
|
go install github.com/axw/gocov/gocov@latest
|
||||||
|
@ -102,7 +102,6 @@ func (l *LocalizerTest) Test_LocalizationMiddleware_Context() {
|
|||||||
|
|
||||||
func (l *LocalizerTest) Test_LocalizationMiddleware_Httptest() {
|
func (l *LocalizerTest) Test_LocalizationMiddleware_Httptest() {
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
r := rand.New(rand.NewSource(time.Now().UnixNano())) // nolint:gosec
|
|
||||||
l.localizer.Preload(DefaultLanguages)
|
l.localizer.Preload(DefaultLanguages)
|
||||||
langMsgMap := map[language.Tag]string{
|
langMsgMap := map[language.Tag]string{
|
||||||
language.English: "Test message",
|
language.English: "Test message",
|
||||||
@ -120,6 +119,7 @@ func (l *LocalizerTest) Test_LocalizationMiddleware_Httptest() {
|
|||||||
for i := 0; i < 1000; i++ {
|
for i := 0; i < 1000; i++ {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func(m map[language.Tag]string, wg *sync.WaitGroup) {
|
go func(m map[language.Tag]string, wg *sync.WaitGroup) {
|
||||||
|
r := rand.New(rand.NewSource(time.Now().UnixNano() + int64(i))) // nolint:gosec
|
||||||
var tag language.Tag
|
var tag language.Tag
|
||||||
switch r.Intn(3-1) + 1 { // nolint:gosec
|
switch r.Intn(3-1) + 1 { // nolint:gosec
|
||||||
case 1:
|
case 1:
|
||||||
|
Loading…
Reference in New Issue
Block a user