Skip to content

Commit

Permalink
Move testkit-server into a separate crate (exonum#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-tkach committed Jun 1, 2018
1 parent 473d124 commit 9f29d54
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
- ./node_modules/.bin/cspell exonum/{src,benches,tests}/**/*.rs
- ./node_modules/.bin/cspell exonum/fuzz/fuzz_targets/*.rs
- ./node_modules/.bin/cspell testkit/{src,examples,tests}/**/*.rs
- ./node_modules/.bin/cspell testkit/server/{src,examples,tests}/**/*.rs
- ./node_modules/.bin/cspell services/configuration/{src,examples}/**/*.rs
- ./node_modules/.bin/cspell services/time/{src,examples,tests}/**/*.rs
- ./node_modules/.bin/cspell examples/cryptocurrency/{src,examples,tests}/**/*.rs
Expand Down Expand Up @@ -130,7 +131,7 @@ jobs:
- powershell
install:
- nvm install 8 && nvm use 8
- cd $TRAVIS_BUILD_DIR/testkit/examples/server && npm install && cd $TRAVIS_BUILD_DIR
- cd $TRAVIS_BUILD_DIR/testkit/server/src && npm install && cd $TRAVIS_BUILD_DIR
script:
- cargo test --all
- cargo run -p exonum --example explorer
Expand All @@ -139,7 +140,7 @@ jobs:
- cargo run -p exonum-time --example simple_service
- cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.sh
- cd $TRAVIS_BUILD_DIR/examples/cryptocurrency/examples && ./test.ps1
- cd $TRAVIS_BUILD_DIR/testkit/examples/server && npm run test:unix
- cd $TRAVIS_BUILD_DIR/testkit/server/src && npm run test:unix

# Benchmarks (compilation only)
- env: FEATURE=benchmarks
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"exonum",
"testkit",
"testkit/server",
"services/configuration",
"services/time",
"examples/cryptocurrency",
Expand Down
2 changes: 1 addition & 1 deletion examples/cryptocurrency-advanced/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/exonum/exonum"
readme = "README.md"
license = "Apache-2.0"
keywords = ["exonum", "blockchain", "example"]
categories = ["rust-patterns"]
categories = ["rust-patterns", "development-tools::testing"]
description = "Exonum blockchain example implementing a cryptocurrency."

[badges]
Expand Down
3 changes: 2 additions & 1 deletion examples/cryptocurrency/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "exonum-cryptocurrency"
version = "0.8.0"
publish = false
version = "0.0.0"
authors = ["The Exonum Team <exonum@bitfury.com>"]
homepage = "https://exonum.com/"
repository = "https://github.com/exonum/exonum"
Expand Down
3 changes: 1 addition & 2 deletions testkit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "exonum-testkit"
version = "0.8.0"
authors = ["The Exonum Team <exonum@bitfury.com>"]
homepage = "https://exonum.com/"
repository = "https://github.com/exonum/exonum-testkit"
repository = "https://github.com/exonum/exonum"
documentation = "https://docs.rs/exonum-testkit"
readme = "README.md"
license = "Apache-2.0"
Expand Down Expand Up @@ -33,7 +33,6 @@ tokio-core = "=0.1.17"
router = "=0.6.0"

[dev-dependencies]
exonum-cryptocurrency = { version = "0.8.0", path = "../examples/cryptocurrency" }
rand = "=0.4.2"
pretty_assertions = "=0.5.1"
assert_matches = "1.2.0"
Expand Down
22 changes: 22 additions & 0 deletions testkit/server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "exonum-testkit-server"
publish = false
version = "0.0.0"
authors = ["The Exonum Team <exonum@bitfury.com>"]
homepage = "https://exonum.com/"
repository = "https://github.com/exonum/exonum"
documentation = "https://docs.rs/exonum-testkit"
readme = "README.md"
license = "Apache-2.0"
keywords = ["test", "blockchain", "framework", "exonum"]
categories = ["development-tools::testing"]
description = "This example demonstrates how to use the testkit together with client-side testing."

[badges]
travis-ci = { repository = "exonum/exonum" }
circle-ci = { repository = "exonum/exonum" }

[dependencies]
exonum = { version = "0.8.0", path = "../../exonum" }
exonum-testkit = { version = "0.8.0", path = ".." }
exonum-cryptocurrency = { version = "0.0.0", path = "../../examples/cryptocurrency" }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"name": "testkit-server",
"version": "0.0.0",
"description": "Client-side testkit-based service testing",
"main": "index.js",
"main": "test/index.js",
"engines": {
"node": ">=8"
},
"private": true,
"scripts": {
"lint": "standard",
"pretest:unix": "npm run posttest:unix && cargo run --example server & sleep 10",
"test": "mocha index.js",
"test:unix": "mocha index.js",
"pretest:unix": "npm run posttest:unix && cargo run & sleep 10",
"test": "mocha test/index.js",
"test:unix": "mocha test/index.js",
"posttest:unix": "lsof -iTCP -sTCP:LISTEN -n -P 2>/dev/null | awk '{ if ($9 == \"*:8000\") { print $2 } }' | xargs -r kill -KILL"
},
"repository": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9f29d54

Please sign in to comment.