-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6c2bf8
commit c4f2007
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Docker file for testing provwasm | ||
FROM golang:1.17-buster as build | ||
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libleveldb-dev | ||
RUN apt-get install -y unzip | ||
|
||
COPY --chown=0:0 ./scripts/setup_provenance.sh /setup_provenance.sh | ||
|
||
# install jq for parsing output of queries when running Provenance | ||
RUN curl -o /usr/local/bin/jq http://stedolan.github.io/jq/download/linux64/jq && \ | ||
chmod +x /usr/local/bin/jq | ||
|
||
# Initialize provenance to run with the default node configuration | ||
ENTRYPOINT ["/setup_provenance.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# action.yml | ||
name: 'Provenance Test' | ||
description: 'Action to test Provenance' | ||
inputs: | ||
provenance_version: # version of Provenance | ||
description: 'Version of Provenance to test against' | ||
required: true | ||
default: 'v1.8.0' | ||
test_script: | ||
description: 'Script used to run tests after provenance has been setup and is running' | ||
required: true | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.test_script }} | ||
- ${{ inputs.provenance_version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash -e | ||
|
||
# This script setups up Provenance and then runs a script it receives as an argument to do various tests afterwards | ||
|
||
Provenance_Version=$2 | ||
|
||
wget "https://github.com/provenance-io/provenance/releases/download/$Provenance_Version/provenance-linux-amd64-$Provenance_Version.zip" | ||
|
||
# this will create a folder with both provenance and libwasm | ||
unzip "provenance-linux-amd64-$Provenance_Version.zip" | ||
|
||
mkdir ./build | ||
|
||
PROV_CMD="./bin/provenanced" | ||
PIO_HOME="./build" | ||
export PIO_HOME | ||
|
||
if [ ! -d "$PIO_HOME/config" ]; then | ||
"$PROV_CMD" -t init --chain-id=testing testing | ||
"$PROV_CMD" -t keys add validator --keyring-backend test | ||
"$PROV_CMD" -t add-genesis-root-name validator pio --keyring-backend test | ||
"$PROV_CMD" -t add-genesis-root-name validator pb --restrict=false \ | ||
--keyring-backend test | ||
"$PROV_CMD" -t add-genesis-root-name validator io --restrict \ | ||
--keyring-backend test | ||
"$PROV_CMD" -t add-genesis-root-name validator provenance \ | ||
--keyring-backend test | ||
"$PROV_CMD" -t add-genesis-account validator 100000000000000000000nhash \ | ||
--keyring-backend test | ||
"$PROV_CMD" -t gentx validator 1000000000000000nhash \ | ||
--keyring-backend test --chain-id=testing | ||
"$PROV_CMD" -t add-genesis-marker 100000000000000000000nhash --manager \ | ||
validator --access mint,burn,admin,withdraw,deposit \ | ||
--activate --keyring-backend test | ||
"$PROV_CMD" -t collect-gentxs | ||
fi | ||
nohup "$PROV_CMD" -t start &>/dev/null & | ||
|
||
echo "Sleeping for provenance to start up" | ||
sleep 10s | ||
|
||
# execute the script test that was passed in as an argument | ||
echo "Executing test..." | ||
"$1" | ||
echo "Test complete" |