Run window post test on circle

This commit is contained in:
Łukasz Magiera 2020-06-01 14:59:51 +02:00
parent ee29a92021
commit b753cd4503
4 changed files with 19 additions and 10 deletions

View File

@ -134,6 +134,9 @@ jobs:
type: string type: string
default: "./..." default: "./..."
description: Import paths of packages to be tested. description: Import paths of packages to be tested.
winpost-test:
type: string
default: "0"
test-suite-name: test-suite-name:
type: string type: string
default: unit default: unit
@ -171,6 +174,7 @@ jobs:
environment: environment:
GOTESTSUM_JUNITFILE: /tmp/test-reports/<< parameters.test-suite-name >>/junit.xml GOTESTSUM_JUNITFILE: /tmp/test-reports/<< parameters.test-suite-name >>/junit.xml
GOTESTSUM_FORMAT: << parameters.gotestsum-format >> GOTESTSUM_FORMAT: << parameters.gotestsum-format >>
LOTUS_TEST_WINDOW_POST: << parameters.winpost-test >>
command: | command: |
mkdir -p /tmp/test-reports/<< parameters.test-suite-name >> mkdir -p /tmp/test-reports/<< parameters.test-suite-name >>
gotestsum -- \ gotestsum -- \
@ -199,6 +203,8 @@ jobs:
test-short: test-short:
<<: *test <<: *test
test-window-post:
<<: *test
build-macos: build-macos:
description: build darwin lotus binary description: build darwin lotus binary
@ -332,10 +338,13 @@ workflows:
jobs: jobs:
- lint-changes: - lint-changes:
args: "--new-from-rev origin/next" args: "--new-from-rev origin/next"
- test:
codecov-upload: true
- mod-tidy-check - mod-tidy-check
- gofmt - gofmt
- test:
codecov-upload: true
- test-window-post:
go-test-flags: "-run=TestWindowedPost"
winpost-test: "1"
- test-short: - test-short:
go-test-flags: "--timeout 10m --short" go-test-flags: "--timeout 10m --short"
filters: filters:

View File

@ -8,12 +8,10 @@ import (
"github.com/filecoin-project/go-address" "github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/sector-storage/stores" "github.com/filecoin-project/sector-storage/stores"
"github.com/filecoin-project/sector-storage/storiface" "github.com/filecoin-project/sector-storage/storiface"
"github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi"
sealing "github.com/filecoin-project/storage-fsm"
"github.com/filecoin-project/lotus/chain/types"
) )
// StorageMiner is a low-level interface to the Filecoin network storage miner node // StorageMiner is a low-level interface to the Filecoin network storage miner node
@ -120,4 +118,4 @@ func (st *SealSeed) Equals(ost *SealSeed) bool {
return bytes.Equal(st.Value, ost.Value) && st.Epoch == ost.Epoch return bytes.Equal(st.Value, ost.Value) && st.Epoch == ost.Epoch
} }
type SectorState = sealing.SectorState type SectorState string

View File

@ -3,6 +3,7 @@ package test
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/filecoin-project/lotus/api"
"os" "os"
"strings" "strings"
"testing" "testing"
@ -85,7 +86,7 @@ func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n i
for n := range toCheck { for n := range toCheck {
st, err := miner.SectorsStatus(ctx, n) st, err := miner.SectorsStatus(ctx, n)
require.NoError(t, err) require.NoError(t, err)
if st.State == sealing.Proving { if st.State == api.SectorState(sealing.Proving) {
delete(toCheck, n) delete(toCheck, n)
} }
if strings.Contains(string(st.State), "Fail") { if strings.Contains(string(st.State), "Fail") {

View File

@ -6,6 +6,7 @@ import (
"crypto/rand" "crypto/rand"
"io/ioutil" "io/ioutil"
"net/http/httptest" "net/http/httptest"
"os"
"testing" "testing"
"time" "time"
@ -517,8 +518,8 @@ func TestPledgeSectors(t *testing.T) {
} }
func TestWindowedPost(t *testing.T) { func TestWindowedPost(t *testing.T) {
if testing.Short() { if os.Getenv("LOTUS_TEST_WINDOW_POST") != "1" {
t.Skip("this takes a while") t.Skip("this takes a few minutes, set LOTUS_TEST_WINDOW_POST=1 to run")
} }
logging.SetLogLevel("miner", "ERROR") logging.SetLogLevel("miner", "ERROR")
@ -527,5 +528,5 @@ func TestWindowedPost(t *testing.T) {
logging.SetLogLevel("sub", "ERROR") logging.SetLogLevel("sub", "ERROR")
logging.SetLogLevel("storageminer", "ERROR") logging.SetLogLevel("storageminer", "ERROR")
test.TestWindowPost(t, mockSbBuilder, 3*time.Millisecond, 10) test.TestWindowPost(t, mockSbBuilder, 5*time.Millisecond, 10)
} }