Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci test #75

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions fail_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package chainlink_feeds

Check failure on line 1 in fail_test.go

View workflow job for this annotation

GitHub Actions / ci-lint

var-naming: don't use an underscore in package name (revive)

import (
"errors"
"os"
"sync"
"testing"
)

func TestFail(t *testing.T) {
if testing.Short() {
t.Skip()
}
t.Fatal("fake failure")
}

func TestRace(t *testing.T) {
var v int
var wg sync.WaitGroup
wg.Add(100)
for i := 0; i < 100; i++ {
go func() {
defer wg.Done()
v++
v--
}()
}
wg.Wait()
t.Log(v)
}

func TestLint(t *testing.T) {
const UnusedVar = 1 // lint should complain for unused variable

Check failure on line 33 in fail_test.go

View workflow job for this annotation

GitHub Actions / ci-lint

const `UnusedVar` is unused (unused)
const ALL_CAPS = 10 // should be AllCaps

Check failure on line 34 in fail_test.go

View workflow job for this annotation

GitHub Actions / ci-lint

var-naming: don't use ALL_CAPS in Go names; use CamelCase (revive)
err := os.ErrNotExist
if err == os.ErrNotExist { // should use errors.Is

Check failure on line 36 in fail_test.go

View workflow job for this annotation

GitHub Actions / ci-lint

comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
err := errors.New("fake error") // shadowed variable
t.Log(err)
}
}
Loading