1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 19:32:24 +08:00

chore(tests) add Short() -> SkipNow() to slowest tests

vanilla:
    21.57 real        45.14 user         8.51 sys

short:
    14.40 real        31.13 user         5.56 sys

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow
2014-11-15 00:19:47 -08:00
committed by Juan Batiz-Benet
parent 25b3106e41
commit ed4a8eb782
14 changed files with 87 additions and 11 deletions

View File

@ -83,6 +83,9 @@ func setupIpnsTest(t *testing.T, node *core.IpfsNode) (*core.IpfsNode, *fstest.M
// Test writing a file and reading it back
func TestIpnsBasicIO(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
_, mnt := setupIpnsTest(t, nil)
defer mnt.Close()
@ -101,6 +104,9 @@ func TestIpnsBasicIO(t *testing.T) {
// Test to make sure file changes persist over mounts of ipns
func TestFilePersistence(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
node, mnt := setupIpnsTest(t, nil)
fname := "/local/atestfile"
@ -126,6 +132,9 @@ func TestFilePersistence(t *testing.T) {
// Test to make sure the filesystem reports file sizes correctly
func TestFileSizeReporting(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
_, mnt := setupIpnsTest(t, nil)
defer mnt.Close()
@ -144,6 +153,9 @@ func TestFileSizeReporting(t *testing.T) {
// Test to make sure you cant create multiple entries with the same name
func TestDoubleEntryFailure(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
_, mnt := setupIpnsTest(t, nil)
defer mnt.Close()
@ -160,6 +172,9 @@ func TestDoubleEntryFailure(t *testing.T) {
}
func TestAppendFile(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
_, mnt := setupIpnsTest(t, nil)
defer mnt.Close()
@ -198,6 +213,9 @@ func TestAppendFile(t *testing.T) {
}
func TestFastRepublish(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
// make timeout noticeable.
osrt := shortRepublishTimeout
@ -299,6 +317,9 @@ func TestFastRepublish(t *testing.T) {
// Test writing a medium sized file one byte at a time
func TestMultiWrite(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
_, mnt := setupIpnsTest(t, nil)
defer mnt.Close()