Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fkneeland-figure committed Mar 24, 2022
1 parent ea9b3f1 commit 26e7ace
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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 ./scripts
COPY --chown=0:0 ./scripts/setup_provenance.sh /setup_provenance.sh

# install jq for parsing output of queries when running Provenance
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A Github action to simplify testing with the Provenance blockchain.
### Summary
This action setups up Provenance in a docker container and allows the user to pass in both the version of provenance to use as well as a test script. After Provenance is up running the test script is executed. This allows testing of any of Provenance's features inside of this docker container as part of a github release process.

### Use
### Use as a github action
For an example of this in use look at the smart contract tests in `provwasm` [link](https://github.com/provenance-io/provwasm/blob/main/.github/workflows/test.yml#L55)

This action is published and can be brought into any project with the following:
Expand All @@ -16,4 +16,20 @@ This action is published and can be brought into any project with the following:
with:
provenance_version: "v1.8.0"
test_script: "./scripts/name_test.sh"
```
### Use as a docker image
The docker image is deployed at: https://hub.docker.com/r/provenanceio/provenance-testing-action
This image can be downloaded and run. However to do so, instead of just running the image you will need to pull the image, create a container, copy the test script and any files it needs into the container and then run it like the following pulled from the `Makefile` in [Provwasm](https://github.com/provenance-io/provwasm)

```Makefile
.PHONY: test-tutorial
test-tutorial: tutorial optimize-tutorial
docker rm -f test_container || true
docker pull provenanceio/provenance-testing-action
docker create --name test_container provenanceio/provenance-testing-action --entrypoint "/scripts/tutorial_test.sh" "$(PROVENANCE_TEST_VERSION)"
docker cp ./scripts test_container:/scripts
docker cp ./contracts test_container:/go/contracts
docker start test_container
```
5 changes: 1 addition & 4 deletions scripts/setup_provenance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

# This script setups up Provenance and then runs a script it receives as an argument to do various tests afterwards

echo "Arguments:"
echo "$@"

# get last argument as Provenance version
# get the last argument as Provenance version (This is because of a difference between running as a docker image and as a github action)
Provenance_Version=${@: -1}

echo "Provenance Version:"
Expand Down

0 comments on commit 26e7ace

Please sign in to comment.