2019-11-15 18:56:26 +00:00
|
|
|
package endtoend
|
|
|
|
|
|
|
|
import (
|
2020-08-01 17:22:53 +00:00
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"strconv"
|
2019-11-15 18:56:26 +00:00
|
|
|
"testing"
|
|
|
|
|
2020-06-11 06:38:15 +00:00
|
|
|
ev "github.com/prysmaticlabs/prysm/endtoend/evaluators"
|
2020-08-01 17:22:53 +00:00
|
|
|
e2eParams "github.com/prysmaticlabs/prysm/endtoend/params"
|
2020-03-22 23:04:23 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/endtoend/types"
|
2019-11-15 18:56:26 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/shared/params"
|
|
|
|
"github.com/prysmaticlabs/prysm/shared/testutil"
|
2020-08-25 15:23:06 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
2019-11-15 18:56:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestEndToEnd_MinimalConfig(t *testing.T) {
|
|
|
|
testutil.ResetCache()
|
2020-05-26 19:04:42 +00:00
|
|
|
params.UseE2EConfig()
|
2020-08-25 15:23:06 +00:00
|
|
|
require.NoError(t, e2eParams.Init(e2eParams.StandardBeaconCount))
|
2019-11-15 18:56:26 +00:00
|
|
|
|
2020-08-01 17:22:53 +00:00
|
|
|
// Run for 10 epochs if not in long-running to confirm long-running has no issues.
|
|
|
|
epochsToRun := 10
|
|
|
|
var err error
|
2020-08-05 14:58:50 +00:00
|
|
|
epochStr, longRunning := os.LookupEnv("E2E_EPOCHS")
|
|
|
|
if longRunning {
|
2020-08-01 17:22:53 +00:00
|
|
|
epochsToRun, err = strconv.Atoi(epochStr)
|
2020-08-25 15:23:06 +00:00
|
|
|
require.NoError(t, err)
|
2020-08-01 17:22:53 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 23:04:23 +00:00
|
|
|
minimalConfig := &types.E2EConfig{
|
2020-08-01 17:22:53 +00:00
|
|
|
BeaconFlags: []string{
|
|
|
|
fmt.Sprintf("--slots-per-archive-point=%d", params.BeaconConfig().SlotsPerEpoch*16),
|
|
|
|
},
|
2020-05-26 19:04:42 +00:00
|
|
|
ValidatorFlags: []string{},
|
2020-08-01 17:22:53 +00:00
|
|
|
EpochsToRun: uint64(epochsToRun),
|
2020-03-22 23:04:23 +00:00
|
|
|
TestSync: true,
|
2020-08-01 17:22:53 +00:00
|
|
|
TestDeposits: true,
|
2020-03-22 23:04:23 +00:00
|
|
|
TestSlasher: true,
|
2020-08-05 14:58:50 +00:00
|
|
|
UsePprof: !longRunning,
|
2020-03-22 23:04:23 +00:00
|
|
|
Evaluators: []types.Evaluator{
|
2020-03-15 05:09:23 +00:00
|
|
|
ev.PeersConnect,
|
2020-04-15 21:20:58 +00:00
|
|
|
ev.HealthzCheck,
|
2020-05-29 16:52:38 +00:00
|
|
|
ev.MetricsCheck,
|
2019-11-15 18:56:26 +00:00
|
|
|
ev.ValidatorsAreActive,
|
|
|
|
ev.ValidatorsParticipating,
|
|
|
|
ev.FinalizationOccurs,
|
2020-08-01 17:22:53 +00:00
|
|
|
ev.ProcessesDepositsInBlocks,
|
|
|
|
ev.ActivatesDepositedValidators,
|
|
|
|
ev.DepositedValidatorsAreActive,
|
2020-05-29 02:51:00 +00:00
|
|
|
ev.ProposeVoluntaryExit,
|
|
|
|
ev.ValidatorHasExited,
|
2020-08-01 17:22:53 +00:00
|
|
|
ev.ColdStateCheckpoint,
|
2019-11-15 18:56:26 +00:00
|
|
|
},
|
|
|
|
}
|
2020-03-22 23:04:23 +00:00
|
|
|
|
2019-11-15 18:56:26 +00:00
|
|
|
runEndToEndTest(t, minimalConfig)
|
|
|
|
}
|