Skip to content

Commit

Permalink
tests: skip cpu intense jwk generation in short mode
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas committed Oct 5, 2017
1 parent c93dcdb commit b410927
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jwk/cast_test.go
Expand Up @@ -7,6 +7,10 @@ import (
)

func TestMustRSAPrivate(t *testing.T) {
if testing.Short() {
t.SkipNow()
}

keys, err := new(RS256Generator).Generate("")
assert.Nil(t, err)

Expand Down
4 changes: 4 additions & 0 deletions jwk/generator_test.go
Expand Up @@ -11,6 +11,10 @@ import (
)

func TestGenerator(t *testing.T) {
if testing.Short() {
t.SkipNow()
}

for k, c := range []struct {
g KeyGenerator
check func(*jose.JsonWebKeySet)
Expand Down
16 changes: 16 additions & 0 deletions rand/numeric/int_test.go
Expand Up @@ -27,6 +27,10 @@ func TestUInt32(t *testing.T) {
}

func TestInt64IsUnique(t *testing.T) {
if testing.Short() {
t.SkipNow()
}

// Probability of collision is around 1 in a million
times := 6000000
s := make(map[int64]bool)
Expand All @@ -43,6 +47,10 @@ func TestInt64IsUnique(t *testing.T) {
}

func TestUInt64IsUnique(t *testing.T) {
if testing.Short() {
t.SkipNow()
}

// Probability of collision is around 1 in a million
times := 6000000
s := make(map[uint64]bool)
Expand All @@ -59,6 +67,10 @@ func TestUInt64IsUnique(t *testing.T) {
}

func TestInt32IsUnique(t *testing.T) {
if testing.Short() {
t.SkipNow()
}

// Probability of collision is around 1 in 1000
times := 3000
s := make(map[int32]bool)
Expand All @@ -75,6 +87,10 @@ func TestInt32IsUnique(t *testing.T) {
}

func TestUInt32IsUnique(t *testing.T) {
if testing.Short() {
t.SkipNow()
}

// Probability of collision is around 1 in 1000
times := 3000
s := make(map[uint32]bool)
Expand Down
4 changes: 4 additions & 0 deletions rand/sequence/sequence_test.go
Expand Up @@ -51,6 +51,10 @@ func TestRuneSequenceMatchesPattern(t *testing.T) {
}

func TestRuneSequenceIsPseudoUnique(t *testing.T) {
if testing.Short() {
t.SkipNow()
}

// 1 in 100 probability of collision
times := 9000
runes := []rune("ab")
Expand Down

0 comments on commit b410927

Please sign in to comment.