Skip to content

Commit

Permalink
test: re-orgonised sandbox doc and sandbox tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hui-an-yang committed Dec 17, 2024
1 parent 26ca83f commit 599ee03
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 67 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ jobs:
run: npm -w integration-tests run sandbox:${{ matrix.testnet }}
- run: npm ci
- run: npm run build
- run: npm -w integration-tests run test __tests__/tezbox/sandbox-proposal-and-ballot-operation.spec.ts
- run: npm -w integration-tests run test __tests__/tezbox/
env:
TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://0.0.0.0:8732
- run: npm -w integration-tests run test __tests__/tezbox/sandbox-drain-delegate-operation.spec
env:
TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://0.0.0.0:8732
TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://0.0.0.0:8732
2 changes: 1 addition & 1 deletion docs/metadata-tzip16.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Tezos = new TezosToolkit('rpcUrl');

// The constructor of the `MetadataProvider` class takes a `Map<string, Handler>` as a parameter.
const customHandler = new Map<string, Handler>([
['ipfs', new IpfsHttpHandler('gateway.ipfs.io')], // Constructor of IpfsHttpHandler takes an optional gateway
['ipfs', new IpfsHttpHandler('ipfs.io')], // Constructor of IpfsHttpHandler takes an optional gateway
['http', 'customHttpHandler'], // Custom HTTP(S) handler
['https', 'customHttpHandler'],
['tezos-storage', new TezosStorageHandler()],
Expand Down
24 changes: 17 additions & 7 deletions integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

The `taquito/integration-tests` directory contains the integration test suite for Taquito. These tests are executed against live Tezos testnets, ensuring a comprehensive evaluation of various Taquito use cases.

The tests may also be run using Flextesa. This is useful for testing new features not in current test nets and for testing features around governance that benefit from shortened block processing times. As well Flextesa tests offer a secondary confirmation of the test net results.
The tests may also be run using tezbox. This is useful for testing new features not in current testnets and for testing features around governance that benefit from shortened block processing times. As well tezbox tests offer a secondary confirmation of the testnet results.

Internally Taquito is tested with tests running in parallel. This is achieved using an application that generates new keys and funds them as needed per test.
The application is not publicly available. External users, therefore, must run the Taquito Integration Tests in sequence, one test at a time.
Expand Down Expand Up @@ -100,13 +100,23 @@ If running the test with a configured secret key, ensure that the account balanc
To review the graphical report of the test run, open the index.html file in ~/taquito/integration-tests/jest-stare after each test run.


## Taquito Integration Tests with Flextesa
## Taquito Integration Tests with Tezbox

:::warning
Due to the discontinuation of Flextesa support from Protocol Oxford onwards, we unfortunately will not be testing against sandboxes anymore.

The only sandbox tests we're running points to the latest Nairobibox to specifically test for the `ballot` and `drain_delegate` operation.
:::
First, run this command to spin up the sandbox provided by [tezbox](https://github.com/tez-capital/tezbox)
This command will override the protocol parameters to 10 `blocks_per_cycle` and 1 second `minimal_block_delay`
```
npm run sandbox:parisnet
```
Then you can run the tests under tezbox subfolder that requires to wait cycles like proposals, ballot and drain_delegate
```
TEZOS_RPC_PARISNET=http://localhost:8732 npm run test __tests__/tezbox/
```
Or if you'd like to run the entire `__tests__` folder run these commands
```
source sandbox-env.sh
npm run originate-known-contracts
npm run test:parisnet-secret-key
```

## The Keygen API

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ CONFIGS().forEach(async ({ rpc, protocol }) => {
expect(localForged).toEqual(rpcForged);
})

it('should toPreapply a prepared a ballot operation accepted by rpc in proposal period in exploration period', async () => {
tezboxnet('should toPreapply a prepared a ballot operation accepted by rpc in proposal period in exploration period', async () => {
// if it's still proposal period make the test sleep to get into exploration period to preapply ballot operation
await sleepUntil('exploration')

Expand Down
1 change: 0 additions & 1 deletion integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"test:secret-key": "RUN_WITH_SECRET_KEY=true jest --runInBand",
"test:parisnet": "PARISNET=true jest",
"test:parisnet-secret-key": "RUN_PARISNET_WITH_SECRET_KEY=true jest --runInBand",
"test:nairobinet-secret-key": "RUN_NAIROBINET_WITH_SECRET_KEY=true jest --runInBand",
"test:weeklynet": "WEEKLYNET=true jest",
"test:weeklynet-secret-key": "RUN_WEEKLYNET_WITH_SECRET_KEY=true jest --runInBand",
"test:ghostnet": "GHOSTNET=true jest",
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/sandbox-env.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
export RUN_NAIROBINET_WITH_SECRET_KEY=true
export SECRET_KEY=edsk3RFgDiCt7tWB2oe96w1eRw72iYiiqZPLu9nnEY23MYRp2d8Kkx
export TEZOS_RPC_NAIROBINET=http://localhost:20000
export RUN_PARISNET_WITH_SECRET_KEY=true
export SECRET_KEY=edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq
export TEZOS_RPC_PARISNET=http://localhost:8732
export POLLING_INTERVAL_MILLISECONDS=100
export RPC_CACHE_MILLISECONDS=0
export TEZOS_BAKER=tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
export TEZOS_BAKER=tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU
48 changes: 0 additions & 48 deletions sandbox-bakers.sh

This file was deleted.

0 comments on commit 599ee03

Please sign in to comment.