From 272c725583a4babaa3a6f0a56441df0d36d1db49 Mon Sep 17 00:00:00 2001 From: Bowen Wang Date: Wed, 16 Jan 2019 15:54:39 -0800 Subject: [PATCH] Update gitignore to ignore hello.wasm (#425) * update gitignore; remove package lock * run test set up inside rust --- .gitignore | 2 + tests/hello/package-lock.json | 110 ---------------------------------- tests/test_rpc_cli.rs | 7 +++ 3 files changed, 9 insertions(+), 110 deletions(-) delete mode 100644 tests/hello/package-lock.json diff --git a/.gitignore b/.gitignore index fe5b4409cb2..972a7376d2a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ /test-utils/ganache/storage /node/service/storage /keystore/ +/tests/hello.wasm +/tests/hello/package-lock.json # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html diff --git a/tests/hello/package-lock.json b/tests/hello/package-lock.json deleted file mode 100644 index 64f76af22bd..00000000000 --- a/tests/hello/package-lock.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "name": "hello-wasm", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "assemblyscript": { - "version": "git+https://github.com/nearprotocol/assemblyscript.git#ea8c884f36b3b8f1a02e8f30b4e57cfab95a3da0", - "from": "git+https://github.com/nearprotocol/assemblyscript.git", - "requires": { - "@protobufjs/utf8": "^1.1.0", - "binaryen": "55.0.0-nightly.20181130", - "glob": "^7.1.3", - "long": "^4.0.0" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "binaryen": { - "version": "55.0.0-nightly.20181130", - "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-55.0.0-nightly.20181130.tgz", - "integrity": "sha512-RfMiI0vavw7Sy7KX8h1xOs4D3zp9nehmtE87DSfY6nXyd2EAdMwJ97tWdepuhOc6JWZsntOfzUA2fqu/sYTTLg==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/tests/test_rpc_cli.rs b/tests/test_rpc_cli.rs index b2f8dd6696a..68f73084163 100644 --- a/tests/test_rpc_cli.rs +++ b/tests/test_rpc_cli.rs @@ -29,6 +29,7 @@ use primitives::test_utils::get_key_pair_from_seed; const TMP_DIR: &str = "./tmp/test_rpc_cli"; const KEY_STORE_PATH: &str = "./tmp/test_rpc_cli/key_store"; +const WASM_PATH: &str = "./tests/hello"; const WAIT_FOR_RETRY: u64 = 500; const MAX_WAIT_FOR_RETRY: u32 = 5; @@ -39,6 +40,12 @@ fn test_service_ready() -> bool { std::fs::remove_dir_all(base_path.clone()).unwrap(); } + Command::new("sh") + .arg("-c") + .arg(&format!("cd {} && npm install && npm run build", WASM_PATH)) + .output() + .expect("build hello.wasm failed"); + let network_cfg = devnet::NetworkConfig::default(); let mut client_cfg = devnet::ClientConfig::default(); client_cfg.base_path = base_path;