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

View File

@ -8,12 +8,10 @@ import (
"github.com/filecoin-project/go-address"
"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/storiface"
"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
@ -120,4 +118,4 @@ func (st *SealSeed) Equals(ost *SealSeed) bool {
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 (
"context"
"fmt"
"github.com/filecoin-project/lotus/api"
"os"
"strings"
"testing"
@ -85,7 +86,7 @@ func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n i
for n := range toCheck {
st, err := miner.SectorsStatus(ctx, n)
require.NoError(t, err)
if st.State == sealing.Proving {
if st.State == api.SectorState(sealing.Proving) {
delete(toCheck, n)
}
if strings.Contains(string(st.State), "Fail") {

View File

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