mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 21:21:11 +00:00
update contributing guide and ui-tests scripts (#1668)
- Updated ./docs/CONTRIBUTION.md to clarify how to use command bot and update ui-tests locally or in PR - Moved update-ui-tests.sh to a root of project to run them along for substrate and polkadot together --------- Co-authored-by: Mira Ressel <mira@parity.io>
This commit is contained in:
@@ -314,8 +314,8 @@ node-bench-regression-guard:
|
||||
--compare-with artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
|
||||
after_script: [""]
|
||||
|
||||
# if this fails (especially after rust version upgrade) run
|
||||
# ./substrate/.maintain/update-rust-stable.sh <rust_version>
|
||||
# if this fails run `bot update-ui` in the Pull Request or "./scripts/update-ui-tests.sh" locally
|
||||
# see ./docs/CONTRIBUTING.md#ui-tests
|
||||
test-frame-ui:
|
||||
stage: test
|
||||
extends:
|
||||
|
||||
+15
-1
@@ -143,4 +143,18 @@ UI tests are used for macros to ensure that the output of a macro doesn’t chan
|
||||
These UI tests are sensible to any changes in the macro generated code or to switching the rust stable version.
|
||||
The tests are only run when the `RUN_UI_TESTS` environment variable is set. So, when the CI is for example complaining
|
||||
about failing UI tests and it is expected that they fail these tests need to be executed locally.
|
||||
To simplify the updating of the UI test output there is the `.maintain/update-rust-stable
|
||||
To simplify the updating of the UI test output there is a script
|
||||
- `./scripts/update-ui-tests.sh` to update the tests for a current rust version locally
|
||||
- `./scripts/update-ui-tests.sh 1.70` # to update the tests for a specific rust version locally
|
||||
|
||||
Or if you have opened PR and you're member of `paritytech` - you can use command-bot to run the tests for you in CI:
|
||||
- `bot update-ui` - will run the tests for the current rust version
|
||||
- `bot update-ui latest --rust_version=1.70.0` - will run the tests for the specified rust version
|
||||
- `bot update-ui latest -v CMD_IMAGE=paritytech/ci-unified:bullseye-1.70.0-2023-05-23 --rust_version=1.70.0` -
|
||||
will run the tests for the specified rust version and specified image
|
||||
|
||||
## Command Bot
|
||||
|
||||
If you're member of **paritytech** org - you can use command-bot to run various of common commands in CI:
|
||||
|
||||
Start with comment in PR: `bot help` to see the list of available commands.
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Script for updating the UI tests for a new rust stable version.
|
||||
#
|
||||
# It needs to be called like this:
|
||||
#
|
||||
# update-rust-stable.sh 1.61
|
||||
#
|
||||
# This will run all UI tests with the rust stable 1.61. The script
|
||||
# requires that rustup is installed.
|
||||
set -e
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Please specify the rust version to use. E.g. update-rust-stable.sh 1.61"
|
||||
exit
|
||||
fi
|
||||
|
||||
RUST_VERSION=$1
|
||||
|
||||
if ! command -v rustup &> /dev/null
|
||||
then
|
||||
echo "rustup needs to be installed"
|
||||
exit
|
||||
fi
|
||||
|
||||
rustup install $RUST_VERSION
|
||||
rustup component add rust-src --toolchain $RUST_VERSION
|
||||
|
||||
# Ensure we run the ui tests
|
||||
export RUN_UI_TESTS=1
|
||||
# We don't need any wasm files for ui tests
|
||||
export SKIP_WASM_BUILD=1
|
||||
# Let trybuild overwrite the .stderr files
|
||||
export TRYBUILD=overwrite
|
||||
|
||||
# Run all the relevant UI tests
|
||||
#
|
||||
# Any new UI tests in different crates need to be added here as well.
|
||||
rustup run $RUST_VERSION cargo test -p orchestra ui
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# Script for updating the UI tests for a new rust stable version.
|
||||
# Exit on error
|
||||
set -e
|
||||
|
||||
# by default current rust stable will be used
|
||||
RUSTUP_RUN=""
|
||||
# check if we have a parameter
|
||||
# ./scripts/update-ui-tests.sh 1.70
|
||||
if [ ! -z "$1" ]; then
|
||||
echo "RUST_VERSION: $1"
|
||||
# This will run all UI tests with the rust stable 1.70.
|
||||
# The script requires that rustup is installed.
|
||||
RUST_VERSION=$1
|
||||
RUSTUP_RUN="rustup run $RUST_VERSION"
|
||||
|
||||
|
||||
echo "installing rustup $RUST_VERSION"
|
||||
if ! command -v rustup &> /dev/null
|
||||
then
|
||||
echo "rustup needs to be installed"
|
||||
exit
|
||||
fi
|
||||
|
||||
rustup install $RUST_VERSION
|
||||
rustup component add rust-src --toolchain $RUST_VERSION
|
||||
fi
|
||||
|
||||
# Ensure we run the ui tests
|
||||
export RUN_UI_TESTS=1
|
||||
# We don't need any wasm files for ui tests
|
||||
export SKIP_WASM_BUILD=1
|
||||
# Let trybuild overwrite the .stderr files
|
||||
export TRYBUILD=overwrite
|
||||
|
||||
# ./substrate
|
||||
$RUSTUP_RUN cargo test -p sp-runtime-interface ui
|
||||
$RUSTUP_RUN cargo test -p sp-api-test ui
|
||||
$RUSTUP_RUN cargo test -p frame-election-provider-solution-type ui
|
||||
$RUSTUP_RUN cargo test -p frame-support-test ui
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Script for updating the UI tests for a new rust stable version.
|
||||
#
|
||||
# It needs to be called like this:
|
||||
#
|
||||
# update-rust-stable.sh 1.61
|
||||
#
|
||||
# This will run all UI tests with the rust stable 1.61. The script
|
||||
# requires that rustup is installed.
|
||||
set -e
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Please specify the rust version to use. E.g. update-rust-stable.sh 1.61"
|
||||
exit
|
||||
fi
|
||||
|
||||
RUST_VERSION=$1
|
||||
|
||||
if ! command -v rustup &> /dev/null
|
||||
then
|
||||
echo "rustup needs to be installed"
|
||||
exit
|
||||
fi
|
||||
|
||||
rustup install $RUST_VERSION
|
||||
rustup component add rust-src --toolchain $RUST_VERSION
|
||||
|
||||
# Ensure we run the ui tests
|
||||
export RUN_UI_TESTS=1
|
||||
# We don't need any wasm files for ui tests
|
||||
export SKIP_WASM_BUILD=1
|
||||
# Let trybuild overwrite the .stderr files
|
||||
export TRYBUILD=overwrite
|
||||
|
||||
# Run all the relevant UI tests
|
||||
#
|
||||
# Any new UI tests in different crates need to be added here as well.
|
||||
rustup run $RUST_VERSION cargo test -p sp-runtime-interface ui
|
||||
rustup run $RUST_VERSION cargo test -p sp-api-test ui
|
||||
rustup run $RUST_VERSION cargo test -p frame-election-provider-solution-type ui
|
||||
rustup run $RUST_VERSION cargo test -p frame-support-test ui
|
||||
Reference in New Issue
Block a user