Skip to content

Commit

Permalink
Merge pull request #740 from RickyLB/fix/gh_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyLB authored Nov 20, 2023
2 parents f21e95d + a47e353 commit 1892712
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ jobs:
- name: "Create env file"
run: |
touch .env
echo OPERATOR_KEY="302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137" >> .env
echo OPERATOR_ID="0.0.2" >> .env
echo HEDERA_NETWORK="localhost" >> .env
echo TEST_OPERATOR_KEY="302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137" >> .env
echo TEST_OPERATOR_ID="0.0.2" >> .env
echo TEST_HEDERA_NETWORK="localhost" >> .env
echo TEST_RUN_NONFREE="1" >> .env
cat .env
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,36 @@ community Discord:
<img alt="" src="https://user-images.githubusercontent.com/753919/167244200-b95cd3a6-6256-4eaf-b9b4-f1f192341485.png" height="60">
</a>

### Integration Tests

Before running the integration tests, an operator key, operator account id, and a network name must be set in an `.env` file.
```bash
# Account that will pay query and transaction fees
TEST_OPERATOR_ACCOUNT_ID=
# Default private key to use to sign for all transactions and queries
TEST_OPERATOR_KEY=
# Network names: `"localhost"`, `"testnet"`, `"previewnet"`, `"mainnet"`
TEST_NETWORK_NAME=
```
```bash
# Run tests
$ cargo test
```

#### Local Environment Testing
Hedera offers a way to run tests through your localhost using the `hedera-local-node` service.

For instructions on how to set up and run local node, follow the steps in the git repository:
https://github.com/hashgraph/hedera-local-node

Once the local node is running in Docker, the appropriate `.env` values must be set:
```bash
TEST_OPERATOR_ACCOUNT_ID=0.0.2
TEST_OPERATOR_KEY=3030020100300706052b8104000a042204205bc004059ffa2943965d306f2c44d266255318b3775bacfec42a77ca83e998f2
TEST_NETWORK_NAME=localhost
```

Lastly, run the tests using `cargo test`

## Contributing

Expand Down

0 comments on commit 1892712

Please sign in to comment.