Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rules go #2975

Merged
merged 6 commits into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .buildkite-bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ build --keep_going
build --test_output=errors
build --flaky_test_attempts=5
build --jobs=50
build --stamp
test --local_test_jobs=2
# Disabled race detection due to unstable test results under constrained environment build kite
# build --features=race
82 changes: 79 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ http_archive(

http_archive(
name = "io_bazel_rules_go",
sha256 = "f04d2373bcaf8aa09bccb08a98a57e721306c8f6043a2a0ee610fd6853dcde3d",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.18.6/rules_go-0.18.6.tar.gz",
sha256 = "8df59f11fb697743cbb3f26cfb8750395f30471e9eabde0d174c3aebc7a1cd39",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.1/rules_go-0.19.1.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/0.19.1/rules_go-0.19.1.tar.gz",
],
)

http_archive(
Expand Down Expand Up @@ -173,6 +176,17 @@ go_repository(
importpath = "github.com/golang/mock",
)

git_repository(
name = "com_google_protobuf",
commit = "09745575a923640154bcf307fba8aedff47f240a",
remote = "https://github.com/protocolbuffers/protobuf",
shallow_since = "1558721209 -0700",
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

# External dependencies

go_repository(
Expand Down Expand Up @@ -546,7 +560,7 @@ go_repository(

go_repository(
name = "org_golang_x_crypto",
commit = "8dd112bcdc25174059e45e07517d9fc663123347",
commit = "4def268fd1a49955bfb3dda92fe3db4f924f2285",
importpath = "golang.org/x/crypto",
)

Expand Down Expand Up @@ -815,6 +829,7 @@ go_repository(

go_repository(
name = "io_k8s_client_go",
build_extra_args = ["-exclude=vendor"],
commit = "8abb21031259350aad0799bb42ba213ee8bb3399",
importpath = "k8s.io/client-go",
)
Expand Down Expand Up @@ -1127,3 +1142,64 @@ go_repository(
load("@com_github_prysmaticlabs_go_ssz//:deps.bzl", "go_ssz_dependencies")

go_ssz_dependencies()

go_repository(
name = "com_github_burntsushi_toml",
commit = "3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005",
importpath = "github.com/BurntSushi/toml",
)

go_repository(
name = "org_golang_google_grpc",
build_file_proto_mode = "disable",
commit = "24b2fb8959201be9ce659bc87b0d590a34c67eae",
importpath = "google.golang.org/grpc",
)

go_repository(
name = "org_golang_x_net",
commit = "da137c7871d730100384dbcf36e6f8fa493aef5b",
importpath = "golang.org/x/net",
)

go_repository(
name = "org_golang_x_text",
commit = "342b2e1fbaa52c93f31447ad2c6abc048c63e475",
importpath = "golang.org/x/text",
)

go_repository(
name = "com_github_golang_glog",
commit = "23def4e6c14b4da8ac2ed8007337bc5eb5007998",
importpath = "github.com/golang/glog",
)

go_repository(
name = "org_golang_x_time",
commit = "9d24e82272b4f38b78bc8cff74fa936d31ccd8ef",
importpath = "golang.org/x/time",
)

go_repository(
name = "com_github_gregjones_httpcache",
commit = "901d90724c7919163f472a9812253fb26761123d",
importpath = "github.com/gregjones/httpcache",
)

go_repository(
name = "com_github_peterbourgon_diskv",
commit = "0be1b92a6df0e4f5cb0a5d15fb7f643d0ad93ce6",
importpath = "github.com/peterbourgon/diskv",
)

go_repository(
name = "com_github_googleapis_gnostic",
commit = "25d8b0b6698593f520d9d8dc5a88e6b16ca9ecc0",
importpath = "github.com/googleapis/gnostic",
)

go_repository(
name = "com_github_google_btree",
commit = "20236160a414454a9c64b6c8829381c6f4bddcaa",
importpath = "github.com/google/btree",
)
2 changes: 1 addition & 1 deletion beacon-chain/core/blocks/spectest/attestation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

func runAttestationTest(t *testing.T, filename string) {
filepath, err := bazel.Runfile("/eth2_spec_tests/tests/operations/attestation/" + filename)
filepath, err := bazel.Runfile("tests/operations/attestation/" + filename)
if err != nil {
t.Fatal(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func runAttesterSlashingTest(t *testing.T, filename string) {
}
}

var attesterSlashingPrefix = "eth2_spec_tests/tests/operations/attester_slashing/"
var attesterSlashingPrefix = "tests/operations/attester_slashing/"

func TestAttesterSlashingMinimal(t *testing.T) {
filepath, err := bazel.Runfile(attesterSlashingPrefix + "attester_slashing_minimal.yaml")
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/blocks/spectest/block_header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func runBlockHeaderTest(t *testing.T, filename string) {
}
}

var blkHeaderPrefix = "eth2_spec_tests/tests/operations/block_header/"
var blkHeaderPrefix = "tests/operations/block_header/"

func TestBlockHeaderMinimal(t *testing.T) {
filepath, err := bazel.Runfile(blkHeaderPrefix + "block_header_minimal.yaml")
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/blocks/spectest/block_processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestBlockProcessingMainnetYaml(t *testing.T) {
}

func runBlockProcessingTest(t *testing.T, filename string) {
filepath, err := bazel.Runfile("/eth2_spec_tests/tests/sanity/blocks/" + filename)
filepath, err := bazel.Runfile("tests/sanity/blocks/" + filename)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/blocks/spectest/deposit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func runDepositTest(t *testing.T, filename string) {
}
}

var depositPrefix = "eth2_spec_tests/tests/operations/deposit/"
var depositPrefix = "tests/operations/deposit/"

func TestDepositMinimalYaml(t *testing.T) {
filepath, err := bazel.Runfile(depositPrefix + "deposit_minimal.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func runProposerSlashingTest(t *testing.T, filename string) {
}
}

var proposerSlashingPrefix = "eth2_spec_tests/tests/operations/proposer_slashing/"
var proposerSlashingPrefix = "tests/operations/proposer_slashing/"

func TestProposerSlashingMinimal(t *testing.T) {
filepath, err := bazel.Runfile(proposerSlashingPrefix + "proposer_slashing_minimal.yaml")
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/blocks/spectest/transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func runTransferTest(t *testing.T, filename string) {
}
}

var transferPrefix = "eth2_spec_tests/tests/operations/transfer/"
var transferPrefix = "tests/operations/transfer/"

func TestTransferMinimal(t *testing.T) {
t.Skip("Transfer tests are disabled. See https://github.com/ethereum/eth2.0-specs/pull/1238#issuecomment-507054595")
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/blocks/spectest/voluntary_exit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func runVoluntaryExitTest(t *testing.T, filename string) {
}
}

var exitPrefix = "eth2_spec_tests/tests/operations/voluntary_exit/"
var exitPrefix = "tests/operations/voluntary_exit/"

func TestVoluntaryExitMinimal(t *testing.T) {
filepath, err := bazel.Runfile(exitPrefix + "voluntary_exit_mainnet.yaml")
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/epoch/spectest/crosslink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func runCrosslinkProcessingTests(t *testing.T, filename string) {
}
}

const crosslinkPrefix = "eth2_spec_tests/tests/epoch_processing/crosslinks/"
const crosslinkPrefix = "tests/epoch_processing/crosslinks/"

func TestCrosslinksProcessingMinimal(t *testing.T) {
filepath, err := bazel.Runfile(crosslinkPrefix + "crosslinks_minimal.yaml")
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/epoch/spectest/final_updates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func runFinalUpdatesTests(t *testing.T, filename string) {
}
}

const finalUpdatesPrefix = "eth2_spec_tests/tests/epoch_processing/final_updates/"
const finalUpdatesPrefix = "tests/epoch_processing/final_updates/"

func TestFinalUpdatesMinimal(t *testing.T) {
filepath, err := bazel.Runfile(finalUpdatesPrefix + "final_updates_minimal.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func runJustificationAndFinalizationTests(t *testing.T, filename string) {
}
}

const justificationAndFinalizationPrefix = "eth2_spec_tests/tests/epoch_processing/justification_and_finalization/"
const justificationAndFinalizationPrefix = "tests/epoch_processing/justification_and_finalization/"

func TestJustificationAndFinalizationMinimal(t *testing.T) {
// TODO(#2891): Verify with ETH2 spec test.
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/epoch/spectest/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func runRegisteryProcessingTests(t *testing.T, filename string) {
}
}

const registryUpdatesPrefix = "eth2_spec_tests/tests/epoch_processing/registry_updates/"
const registryUpdatesPrefix = "tests/epoch_processing/registry_updates/"

func TestRegistryProcessingMinimal(t *testing.T) {
filepath, err := bazel.Runfile(registryUpdatesPrefix + "registry_updates_minimal.yaml")
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/epoch/spectest/slashings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func runSlashingsTests(t *testing.T, filename string) {
}
}

const slashingsPrefix = "eth2_spec_tests/tests/epoch_processing/slashings/"
const slashingsPrefix = "tests/epoch_processing/slashings/"

func TestSlashingsMinimal(t *testing.T) {
filepath, err := bazel.Runfile(slashingsPrefix + "slashings_minimal.yaml")
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/core/state/spectest/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

func TestGenesisInitializationMinimal(t *testing.T) {
t.Skip("Tests will fail with mainnet config - awaiting mainnet tests from the researchers")
filepath, err := bazel.Runfile("/eth2_spec_tests/tests/genesis/initialization/genesis_initialization_minimal.yaml")
filepath, err := bazel.Runfile("tests/genesis/initialization/genesis_initialization_minimal.yaml")
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -66,7 +66,7 @@ func TestGenesisInitializationMinimal(t *testing.T) {
}

func TestGenesisValidityMinimal(t *testing.T) {
filepath, err := bazel.Runfile("/eth2_spec_tests/tests/genesis/validity/genesis_validity_minimal.yaml")
filepath, err := bazel.Runfile("tests/genesis/validity/genesis_validity_minimal.yaml")
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/state/spectest/slot_processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func TestSlotProcessingMainnet(t *testing.T) {
filepath, err := bazel.Runfile("/eth2_spec_tests/tests/sanity/slots/sanity_slots_mainnet.yaml")
filepath, err := bazel.Runfile("tests/sanity/slots/sanity_slots_mainnet.yaml")
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/utils/spectest/shuffle_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/prysmaticlabs/prysm/shared/params/spectest"
)

const shufflePrefix = "eth2_spec_tests/tests/shuffling/core/"
const shufflePrefix = "tests/shuffling/core/"

func TestShufflingMinimal(t *testing.T) {
helpers.ClearAllCaches()
Expand Down
2 changes: 1 addition & 1 deletion proto/testing/ssz_compatibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

func TestYamlStatic(t *testing.T) {
topPath := "/eth2_spec_tests/tests/ssz_static/core/"
topPath := "tests/ssz_static/core/"
yamlFileNames := []string{
"ssz_mainnet_random.yaml",
}
Expand Down
2 changes: 1 addition & 1 deletion shared/bls/spectest/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/bazelbuild/rules_go/go/tools/bazel"
)

const prefix = "/eth2_spec_tests/tests/bls/"
const prefix = "tests/bls/"

// Load BLS yaml from spec test bls directory. The file parameter should be in
// the format of the path starting at the bls directory.
Expand Down