difftreelog
ci fix js-packages paths
in: master
18 files changed
.github/workflows/collator-selection.ymldiffbeforeafterboth--- a/.github/workflows/collator-selection.yml
+++ b/.github/workflows/collator-selection.yml
@@ -181,7 +181,7 @@
yarn add mochawesome
# Wanted by both wait_for_first_block
# export RPC_URL="${RELAY_SAPPHIRE_HTTP_URL:-${RELAY_OPAL_HTTP_URL:-${RELAY_QUARTZ_HTTP_URL:-${RELAY_UNIQUE_HTTP_URL:-}}}}"
- ../scripts/src/generate_types/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn testCollators --reporter mochawesome --reporter-options reportFilename=test-collators-${NOW}
env:
.github/workflows/forkless-update-data.ymldiffbeforeafterboth--- a/.github/workflows/forkless-update-data.yml
+++ b/.github/workflows/forkless-update-data.yml
@@ -146,19 +146,19 @@
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}})
- name: "Reconcile: runtime is upgraded"
- working-directory: tests
+ working-directory: js-packages/tests
run: |
yarn
- ./scripts/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
echo "Executing upgrade"
- yarn ts-node --esm src/util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm
+ yarn ts-node --esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: Run Parallel tests after forkless upgrade
- working-directory: tests
+ working-directory: js-packages/tests
run: |
- ./scripts/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
env:
@@ -166,7 +166,7 @@
- name: Run Sequential tests after forkless upgrade
if: success() || failure()
- working-directory: tests
+ working-directory: js-packages/tests
run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth--- a/.github/workflows/forkless-update-nodata.yml
+++ b/.github/workflows/forkless-update-nodata.yml
@@ -161,19 +161,19 @@
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}})
- name: "Reconcile: runtime is upgraded"
- working-directory: tests
+ working-directory: js-packages/tests
run: |
yarn
- ./scripts/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
echo "Executing upgrade"
- yarn ts-node --esm src/util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm
+ yarn ts-node --esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: Run Parallel tests after forkless upgrade
- working-directory: tests
+ working-directory: js-packages/tests
run: |
- ./scripts/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
env:
@@ -181,7 +181,7 @@
- name: Run Sequential tests after forkless upgrade
if: success() || failure()
- working-directory: tests
+ working-directory: js-packages/tests
run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
.github/workflows/governance.ymldiffbeforeafterboth--- a/.github/workflows/governance.yml
+++ b/.github/workflows/governance.yml
@@ -86,7 +86,7 @@
run: |
yarn install
yarn add mochawesome
- ../scripts/src/generate_types/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn testGovernance --reporter mochawesome --reporter-options reportFilename=test-${NOW}
env:
.github/workflows/make-bench.ymldiffbeforeafterboth1# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837012/Code+style+testing2# Nested workflow for checks related to formatting Rust code 34name: make-bench56# Triger: only call from main workflow(re-usable workflows)7on:8 push:9 branches:10 - "feature/ci-make-bench"11 workflow_dispatch:1213jobs:14 make-bench:15 runs-on: [ bench ]16 steps:17 - name: Clean Workspace18 uses: AutoModality/action-clean@v1.1.01920 - uses: actions/checkout@v3.3.021 with:22 ref: develop 2324 - name: Read .env file25 uses: xom9ikk/dotenv@v2.1.1 2627 - name: Install substrate dependencies28 run: sudo apt install -y curl cmake make libssl-dev pkg-config libclang-dev clang protobuf-compiler2930 - name: Install actual toolchain31 uses: actions-rs/toolchain@v1.0.732 with:33 toolchain: ${{ env.RUST_TOOLCHAIN }}34 default: true35 target: wasm32-unknown-unknown3637 - uses: actions/setup-node@v338 with:39 node-version: 184041 - name: RUN benchmarking42 run: |43 time make bench4445 - name: Run node dev mode in background46 working-directory: ./47 run: |48 ./target/release/unique-collator --dev &4950 - name: RUN Calibrate51 working-directory: ./tests52 run: |53 yarn install54 yarn ts-node --esm src/calibrate.ts55 yarn ts-node --esm src/calibrateApply.ts56 57 - name: show git diff58 run: |59 git diff6061 - name: Create Pull Request62 uses: peter-evans/create-pull-request@v4.2.363 with:64 base: develop65 branch: ci/make-bench66 commit-message: commit benchmarking67 committer: Unique <noreply@github.com>68 author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>69 signoff: false70 delete-branch: true71 title: 'CI Make Benchmarking'72 assignees: CertainLach73 reviewers: CertainLach.github/workflows/market-test.ymldiffbeforeafterboth--- a/.github/workflows/market-test.yml
+++ b/.github/workflows/market-test.yml
@@ -119,10 +119,10 @@
# Temporary disable node readyness check. Have to dig into the script logic.
# - name: Wait for chain up and running
-# working-directory: tests
+# working-directory: js-packages/tests
# run: |
# yarn install
-# ./scripts/wait_for_first_block.sh
+# ../scripts/wait_for_first_block.sh
# echo "Ready to start tests"
# env:
# RPC_URL: http://127.0.0.1:9944/
.github/workflows/node-only-update.ymldiffbeforeafterboth--- a/.github/workflows/node-only-update.yml
+++ b/.github/workflows/node-only-update.yml
@@ -170,6 +170,7 @@
run: |
yarn
yarn add mochawesome
+ # TODO: Update to new script structure after mainnet will have it
./scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
@@ -197,7 +198,7 @@
- name: Ensure network is alive
if: success()
run: |
- ./tests/scripts/wait_for_first_block.sh
+ ./js-packages/scripts/wait_for_first_block.sh
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
@@ -217,6 +218,7 @@
run: |
yarn install
yarn add mochawesome
+ # TODO: Update to new script structure after mainnet will have it
./scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
.github/workflows/polkadot-types.ymldiffbeforeafterboth--- a/.github/workflows/polkadot-types.yml
+++ b/.github/workflows/polkadot-types.yml
@@ -74,13 +74,13 @@
# run: sudo apt install jq -y
- name: Run generate_types_package script
- working-directory: tests
+ working-directory: js-packages
run: |
yarn install
- /bin/bash ./scripts/generate_types/wait_for_first_block.sh
+ ./scripts/wait_for_first_block.sh
git config --global user.name "Unique"
git config --global user.email github-actions@usetech.com
- /bin/bash ./scripts/generate_types/generate_types_package.sh --release ${{ matrix.usage }} --push
+ ./scripts/generate_types/generate_types_package.sh --release ${{ matrix.usage }} --push
env:
RPC_URL: http://127.0.0.1:9944/
.github/workflows/xcm.ymldiffbeforeafterboth--- a/.github/workflows/xcm.yml
+++ b/.github/workflows/xcm.yml
@@ -327,22 +327,22 @@
retention-days: 2
- name: Yarn install
- working-directory: tests
+ working-directory: js-packages/tests
run: |
yarn install
yarn add mochawesome
- name: Call HRMP initialization
- working-directory: tests
+ working-directory: js-packages/tests
run: |
- yarn ts-node --esm src/util/createHrmp.ts ${{matrix.network}}
+ yarn ts-node --esm util/createHrmp.ts ${{matrix.network}}
- name: Run XCM tests
working-directory: js-packages/tests
run: |
# Wanted by both wait_for_first_block
export RPC_URL="${RELAY_OPAL_HTTP_URL:-${RELAY_QUARTZ_HTTP_URL:-${RELAY_UNIQUE_HTTP_URL:-}}}"
- ../scripts/src/generate_types/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
.github/workflows/yarn-dev.ymldiffbeforeafterboth--- a/.github/workflows/yarn-dev.yml
+++ b/.github/workflows/yarn-dev.yml
@@ -66,7 +66,7 @@
run: |
yarn install
yarn add mochawesome
- ../scripts/src/generate_types/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
env:
@@ -90,13 +90,13 @@
working-directory: js-packages/scripts
run: |
yarn install
- npx ts-node --esm ./src/benchmarks/mintFee/index.ts
+ npx ts-node --esm ./benchmarks/mintFee/index.ts
- name: Run benchmark opsFee tests
working-directory: js-packages/scripts
run: |
yarn install
- npx ts-node --esm ./src/benchmarks/opsFee/index.ts
+ npx ts-node --esm ./benchmarks/opsFee/index.ts
- name: Stop running containers
if: always() # run this step always
Makefilediffbeforeafterboth--- a/Makefile
+++ b/Makefile
@@ -7,25 +7,25 @@
@echo " bench-unique"
NATIVE_FUNGIBLE_EVM_STUBS=./pallets/balances-adapter/src/stubs
-NATIVE_FUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/nativeFungible.json
+NATIVE_FUNGIBLE_EVM_ABI=./js-packages/tests/eth/abi/nativeFungible.json
FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs
-FUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/fungible.json
+FUNGIBLE_EVM_ABI=./js-packages/tests/eth/abi/fungible.json
NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs
-NONFUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/nonFungible.json
+NONFUNGIBLE_EVM_ABI=./js-packages/tests/eth/abi/nonFungible.json
REFUNGIBLE_EVM_STUBS=./pallets/refungible/src/stubs
-REFUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/reFungible.json
-REFUNGIBLE_TOKEN_EVM_ABI=./js-packages/tests/src/eth/abi/reFungibleToken.json
+REFUNGIBLE_EVM_ABI=./js-packages/tests/eth/abi/reFungible.json
+REFUNGIBLE_TOKEN_EVM_ABI=./js-packages/tests/eth/abi/reFungibleToken.json
CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/
-CONTRACT_HELPERS_ABI=./js-packages/tests/src/eth/abi/contractHelpers.json
+CONTRACT_HELPERS_ABI=./js-packages/tests/eth/abi/contractHelpers.json
COLLECTION_HELPER_STUBS=./pallets/unique/src/eth/stubs/
-COLLECTION_HELPER_ABI=./js-packages/tests/src/eth/abi/collectionHelpers.json
+COLLECTION_HELPER_ABI=./js-packages/tests/eth/abi/collectionHelpers.json
-TESTS_API=./js-packages/tests/src/eth/api/
+TESTS_API=./js-packages/tests/eth/api/
.PHONY: regenerate_solidity
regenerate_solidity: UniqueFungible.sol UniqueNFT.sol UniqueRefungible.sol UniqueRefungibleToken.sol ContractHelpers.sol CollectionHelpers.sol
doc/separate_rpc.mddiffbeforeafterboth--- a/doc/separate_rpc.md
+++ b/doc/separate_rpc.md
@@ -77,7 +77,7 @@
* runtime/quartz/Cargo.toml
* runtime/unique/Cargo.toml
-7. Create tests/src/interfaces/ModuleName/definitions.ts and describe the necessary methods in it.
+7. Create js-packages/types/ModuleName/definitions.ts and describe the necessary methods in it.
```ts
type RpcParam = {
name: string;
@@ -105,19 +105,19 @@
};
```
-8. Describe definitions from paragraph 7 in tests/src/interfaces/definitions.ts.
+8. Describe definitions from paragraph 7 in js-packages/types/definitions.ts.
```ts
export {default as ModuleName} from './module/definitions';
```
-9. tests/src/substrate/substrate-api.ts
+9. js-packages/tests/substrate/substrate-api.ts
* Set the RPC interface in the `defaultApiOptions` function, add an entry in the `rpc` parameter
```ts
module: defs.module.rpc,
```
-10. tests/src/util/playgrounds/unique.dev.ts
+10. js-packages/playgrounds/unique.dev.ts
* Specify RPC interface in `connect` function, add entry in `rpc` parameter
```ts
module: defs.module.rpc,
- ```
\ No newline at end of file
+ ```
js-packages/.dockerignorediffbeforeafterboth--- a/js-packages/.dockerignore
+++ b/js-packages/.dockerignore
@@ -1,2 +1 @@
node_modules/
-Dockerfile-tests
js-packages/Dockerfile-testsdiffbeforeafterboth--- a/js-packages/Dockerfile-tests
+++ /dev/null
@@ -1,38 +0,0 @@
-# ===== Integration Tests ======
-
-
-FROM ubuntu:22.04
-LABEL maintainer="UniqueNetwork.io"
-
-RUN apt -y update; apt -y upgrade; apt -y install curl
-
-
-RUN mkdir unique_parachain
-WORKDIR /unique_parachain
-
-RUN apt-get -y update && \
- apt-get -y upgrade && \
- apt-get -y install curl jq && \
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \
- export NVM_DIR="$HOME/.nvm" && \
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
- nvm install v16.2.0 && \
- nvm alias default v16.2.0 && \
- nvm use default
-
-ENV YARN_CACHE_FOLDER ~/.yarn
-
-COPY package.json yarn.lock ./
-
-RUN export NVM_DIR="$HOME/.nvm" && \
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
- npm install --global yarn && \
- yarn add mochawesome && \
- yarn --pure-lockfile
-
-COPY . .
-
-CMD export NVM_DIR="$HOME/.nvm" && \
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
- ./scripts/wait_for_first_block.sh && \
- NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
js-packages/scripts/benchmarks/mintFee/index.tsdiffbeforeafterboth--- a/js-packages/scripts/benchmarks/mintFee/index.ts
+++ b/js-packages/scripts/benchmarks/mintFee/index.ts
@@ -14,23 +14,23 @@
export const CONTRACT_IMPORT: ContractImports[] = [
{
- fsPath: `${dirname}/../../../../tests/eth/api/CollectionHelpers.sol`,
+ fsPath: `${dirname}/../../../tests/eth/api/CollectionHelpers.sol`,
solPath: 'eth/api/CollectionHelpers.sol',
},
{
- fsPath: `${dirname}/../../../../tests/eth/api/ContractHelpers.sol`,
+ fsPath: `${dirname}/../../../tests/eth/api/ContractHelpers.sol`,
solPath: 'eth/api/ContractHelpers.sol',
},
{
- fsPath: `${dirname}/../../../../tests/eth/api/UniqueRefungibleToken.sol`,
+ fsPath: `${dirname}/../../../tests/eth/api/UniqueRefungibleToken.sol`,
solPath: 'eth/api/UniqueRefungibleToken.sol',
},
{
- fsPath: `${dirname}/../../../../tests/eth/api/UniqueRefungible.sol`,
+ fsPath: `${dirname}/../../../tests/eth/api/UniqueRefungible.sol`,
solPath: 'eth/api/UniqueRefungible.sol',
},
{
- fsPath: `${dirname}/../../../../tests/eth/api/UniqueNFT.sol`,
+ fsPath: `${dirname}/../../../tests/eth/api/UniqueNFT.sol`,
solPath: 'eth/api/UniqueNFT.sol',
},
];
js-packages/scripts/package.jsondiffbeforeafterboth--- a/js-packages/scripts/package.json
+++ b/js-packages/scripts/package.json
@@ -14,10 +14,10 @@
"tslib": "^2.6.2"
},
"scripts": {
- "benchMintingFee": "ts-node src/benchmarks/mintFee/benchmark.ts",
- "loadTransfer": "ts-node src/transfer.nload.ts",
- "generateEnv": "ts-node --esm ./src/generateEnv.ts",
- "propose-upgrade": "ts-node --esm ./src/proposeupgrade.ts",
- "propose-fast-track": "ts-node --esm ./src/proposefasttrack.ts"
+ "benchMintingFee": "ts-node benchmarks/mintFee/benchmark.ts",
+ "loadTransfer": "ts-node transfer.nload.ts",
+ "generateEnv": "ts-node --esm ./generateEnv.ts",
+ "propose-upgrade": "ts-node --esm ./proposeupgrade.ts",
+ "propose-fast-track": "ts-node --esm ./proposefasttrack.ts"
}
}
js-packages/scripts/wait_for_first_block.shdiffbeforeafterboth--- /dev/null
+++ b/js-packages/scripts/wait_for_first_block.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+DIR=$(dirname "$0")
+
+. "$DIR/functions.sh"
+
+last_block_id=0
+block_id=0
+function get_block {
+ block_id_hex=$(do_rpc chain_getHeader | jq -r .result.number)
+ block_id=$((block_id_hex))
+ echo Id = $block_id
+}
+
+function had_new_block {
+ last_block_id=$block_id
+ get_block
+ if (( last_block_id != 0 && block_id > last_block_id )); then
+ return 0
+ fi
+ return 1
+}
+
+function reset_check {
+ last_block_id=0
+ block_id=0
+}
+
+while ! had_new_block; do
+ echo "Waiting for next block..."
+ sleep 12
+done
+reset_check
+
+echo "Chain is running, but lets wait for another block after a minute, to avoid startup flakiness."
+sleep 60
+
+while ! had_new_block; do
+ echo "Waiting for another block..."
+ sleep 12
+done
+
+echo "Chain is running!"
js-packages/tests/package.jsondiffbeforeafterboth--- a/js-packages/tests/package.json
+++ b/js-packages/tests/package.json
@@ -26,6 +26,10 @@
"_test": "yarn setup && mocha --timeout 9999999 --loader=ts-node/esm.mjs",
"_testParallel": "yarn setup && mocha --timeout 9999999 --parallel --loader=ts-node/esm.mjs",
"test": "yarn _test './**/*.*test.ts'",
+ "testParallel": "yarn _testParallel './**/*.test.ts'",
+ "testSequential": "yarn _test './**/*.seqtest.ts'",
+ "testGovernance": "RUN_GOV_TESTS=1 yarn _test ./**/governance/*.*test.ts",
+ "testCollators": "RUN_COLLATOR_TESTS=1 yarn _test ./**/collator-selection/**.*test.ts --timeout 49999999",
"load": "yarn _test './**/*.load.ts'"
}
}