Skip to content

Commit

Permalink
chore: move portal-hive history tests to history folder
Browse files Browse the repository at this point in the history
  • Loading branch information
KolbyML committed Jan 2, 2024
1 parent 4866b70 commit ccf34df
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ jobs:
build-simulator-dockerfile:
docker:
- image: cimg/base:2022.06
parallelism: 5
parallelism: 6
steps:
- setup_remote_docker:
version: 20.10.14
- checkout
- run:
name: "Build dockerfile for simulator"
command: |
SimDockerfile=$(circleci tests glob "simulators/*/Dockerfile" | circleci tests split --split-by=timings)
SimDockerfile=$(circleci tests glob "simulators/**/Dockerfile" | circleci tests split --split-by=timings)
echo "Building Docker file: $SimDockerfile"
docker build -f $SimDockerfile .
workflows:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ workspace
# don't include target files
hivesim-rs/Cargo.lock
hivesim-rs/target
simulators/*/Cargo.lock
simulators/*/target
simulators/**/Cargo.lock
simulators/**/target
node_modules/
dist/
hiveview
Expand Down
2 changes: 1 addition & 1 deletion internal/libhive/inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestInventory(t *testing.T) {
}
})
t.Run("HasSimulator", func(t *testing.T) {
if !inv.HasSimulator("rpc-compat") {
if !inv.HasSimulator("history/rpc-compat") {
t.Error("can't find rpc-compat simulator")
}
if inv.HasSimulator("unknown simulator name") {
Expand Down
21 changes: 21 additions & 0 deletions simulators/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Portal Simulators
Portal simulators are sorted by folders indictacting what networks are being tested.

The names of folder are
- all lowercase
- dash seperated
- network names are sorted alphabetically

## Examples of valid folder names :heavy_check_mark:
- ``history``
- ``beacon``
- ``state``
- ``beacon-history``
- ``beacon-history-state``
- ``beacon-state``
- ``history-state``

## Examples of invlaid folder names :x:
- ``history-beacon``
- ``state-beacon``
- ``state-history-beacon``
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"

[dependencies]
ethportal-api = { git = "https://github.com/ethereum/trin", rev = "2a32224e3c2b0b80bc37c1b692c33016371f197a" }
hivesim = { path = "../../hivesim-rs" }
hivesim = { path = "../../../hivesim-rs" }
itertools = "0.10.5"
serde_json = "1.0.87"
serde_yaml = "0.9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ RUN USER=root cargo new --bin portal-interop
WORKDIR /portal-interop

# copy over manifests and source to build image
COPY ./simulators/portal-interop/Cargo.toml ./Cargo.toml
COPY ./simulators/portal-interop/src ./src
COPY ./hivesim-rs ./../../hivesim-rs
COPY ./simulators/history/portal-interop/Cargo.toml ./Cargo.toml
COPY ./simulators/history/portal-interop/src ./src
COPY ./hivesim-rs ./../../../hivesim-rs

# build for release
RUN cargo build --release
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"

[dependencies]
ethportal-api = { git = "https://github.com/ethereum/trin", rev = "2a32224e3c2b0b80bc37c1b692c33016371f197a" }
hivesim = { path = "../../hivesim-rs" }
hivesim = { path = "../../../hivesim-rs" }
itertools = "0.10.5"
serde_json = "1.0.87"
tokio = { version = "1", features = ["full"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ RUN USER=root cargo new --bin portal-mesh
WORKDIR /portal-mesh

# copy over manifests and source to build image
COPY ./simulators/portal-mesh/Cargo.toml ./Cargo.toml
COPY ./simulators/portal-mesh/src ./src
COPY ./hivesim-rs ./../../hivesim-rs
COPY ./simulators/history/portal-mesh/Cargo.toml ./Cargo.toml
COPY ./simulators/history/portal-mesh/src ./src
COPY ./hivesim-rs ./../../../hivesim-rs

# build for release
RUN cargo build --release
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"

[dependencies]
ethportal-api = { git = "https://github.com/ethereum/trin", rev = "2a32224e3c2b0b80bc37c1b692c33016371f197a" }
hivesim = { path = "../../hivesim-rs" }
hivesim = { path = "../../../hivesim-rs" }
futures = "0.3.25"
serde_json = "1.0.87"
tracing = "0.1.37"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ RUN USER=root cargo new --bin rpc-compat
WORKDIR /rpc-compat

# copy over manifests and source to build image
COPY ./simulators/rpc-compat/Cargo.toml ./Cargo.toml
COPY ./simulators/rpc-compat/src ./src
COPY ./hivesim-rs ./../../hivesim-rs
COPY ./simulators/history/rpc-compat/Cargo.toml ./Cargo.toml
COPY ./simulators/history/rpc-compat/src ./src
COPY ./hivesim-rs ./../../../hivesim-rs

# build for release
RUN cargo build --release
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"

[dependencies]
ethportal-api = { git = "https://github.com/ethereum/trin", rev = "b530dc3d40d51c21c800089eacb2852ebd8c4d45" }
hivesim = { path = "../../hivesim-rs" }
hivesim = { path = "../../../hivesim-rs" }
itertools = "0.10.5"
serde_yaml = "0.9"
tokio = { version = "1", features = ["full"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ WORKDIR /trin-bridge
RUN apt-get update && apt-get install clang -y

# copy over manifests and source to build image
COPY ./simulators/trin-bridge/Cargo.toml ./Cargo.toml
COPY ./simulators/trin-bridge/src ./src
COPY ./hivesim-rs ./../../hivesim-rs
COPY ./simulators/history/trin-bridge/Cargo.toml ./Cargo.toml
COPY ./simulators/history/trin-bridge/src ./src
COPY ./hivesim-rs ./../../../hivesim-rs

# build for release
RUN cargo build --release
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function run {
function testrpc {
client=$1
echo "$(date) Starting hive rpc-compat simulation [$client]"
run "./hive --sim rpc-compat --client $client --sim.loglevel 5 $FLAGS"
run "./hive --sim history/rpc-compat --client $client --sim.loglevel 5 $FLAGS"
}

mkdir $RESULTS
Expand Down

0 comments on commit ccf34df

Please sign in to comment.