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

Add E2E testing framework MVP #1395

Merged
merged 20 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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
4 changes: 3 additions & 1 deletion .config/cargo_spellcheck.dic
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dereferencing
deserialize/S
deserialization
dispatchable/S
E2E
encodable
evaluable
fuzzer
Expand Down Expand Up @@ -97,6 +98,7 @@ layout/JG
namespace/S
parameterize/SD
runtime/S
storable
struct/S
vec/S
vector/S
Expand All @@ -107,4 +109,4 @@ natively
payability
unpayable
initializer
storable
WebSocket/S
28 changes: 23 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ workflow:
tags:
- kubernetes-parity-build

.start-substrate-contracts-node: &start-substrate-contracts-node
- substrate-contracts-node -linfo,runtime::contracts=debug 2>&1 | tee /tmp/contracts-node.log &

#### stage: lint
#
# Note: For all of these lints we `allow_failure` so that the rest of the build can
Expand Down Expand Up @@ -285,11 +288,25 @@ docs:
paths:
- ./crate-docs/
script:
- cargo doc --no-deps --all-features
-p scale-info -p ink_metadata -p ink_env
-p ink_storage -p ink_storage_traits -p ink_storage_codegen -p ink_storage_derive
-p ink_primitives -p ink_prelude
-p ink_lang -p ink_lang_macro -p ink_lang_ir -p ink_lang_codegen
# All crate docs currently need to be built separately. The reason
# is that `smart-bench-macro` is a dependency now in a number of places.
# This crate uses e.g. `ink_metadata`, but in its published form. So if
# e.g. the `-p ink_metadata` is added to the `ink_lang` command this
# results in the cargo failure "multiple packages with same spec, ambiguous".
# TODO(#XXX) We might be able to remove this again once we've forked
# `smart-bench-macro` into the ink! repository.
- cargo doc --no-deps --all-features -p ink_env
- cargo doc --no-deps --all-features -p ink_storage
- cargo doc --no-deps --all-features -p ink_storage_codegen
- cargo doc --no-deps --all-features -p ink_storage_traits
- cargo doc --no-deps --all-features -p ink_storage_derive
- cargo doc --no-deps --all-features -p ink_primitives
- cargo doc --no-deps --all-features -p ink_prelude
- cargo doc --no-deps --all-features -p ink_lang
- cargo doc --no-deps --all-features -p ink_lang_macro
- cargo doc --no-deps --all-features -p ink_lang_ir
- cargo doc --no-deps --all-features -p ink_lang_codegen
- cargo doc --no-deps --all-features -p ink_metadata
- mv ${CARGO_TARGET_DIR}/doc ./crate-docs
# FIXME: remove me after CI image gets nonroot
- chown -R nonroot:nonroot ./crate-docs
Expand Down Expand Up @@ -349,6 +366,7 @@ examples-test:
- job: clippy-std
artifacts: false
script:
- *start-substrate-contracts-node
- for example in examples/*/; do
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
cargo test --verbose --manifest-path ${example}/Cargo.toml;
Expand Down
21 changes: 21 additions & 0 deletions crates/env/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ secp256k1 = { version = "0.24", features = ["recovery", "global-context"], optio
rand = { version = "0.8", default-features = false, features = ["alloc"], optional = true }
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }

contract-metadata = "2.0.0-alpha.1"
impl-serde = { version = "0.3.1", default-features = false }
jsonrpsee = { version = "0.14.0", features = ["ws-client"] }
pallet-contracts-primitives = "6.0.0"
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
serde_json = "1.0.81"
tokio = { version = "1.18.2", features = ["rt-multi-thread"] }
log = "0.4"
env_logger = "0.8"
# TODO we need to use `subxt`'s `master` until the next release is published.
subxt = { git = "https://github.com/paritytech/subxt" }
cmichi marked this conversation as resolved.
Show resolved Hide resolved

# Substrate
sp-rpc = "6.0.0"
sp-core = "6.0.0"
sp-keyring = "6.0.0"
sp-runtime = "6.0.0"

# TODO(#xxx) `smart-bench_macro` needs to be forked.
smart-bench-macro = { git = "https://github.com/paritytech/smart-bench", branch = "cmichi-ink-e2e-test-mvp", package = "smart-bench-macro"}

cmichi marked this conversation as resolved.
Show resolved Hide resolved
[features]
default = ["std"]
std = [
Expand Down
Binary file added crates/env/metadata/contracts-node.scale
Binary file not shown.
Loading