Skip to content

Commit

Permalink
Run tests 100 times
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Jul 25, 2021
1 parent df2b78a commit 77eda9c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...
run: go test ./... -count=100
5 changes: 2 additions & 3 deletions programs/serum/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
func TestFetchMarket(t *testing.T) {
rpcURL := os.Getenv("RPC_URL")
if rpcURL == "" {
t.Skip("Setup 'RPC_URL' to run test i.e. 'http://api.mainnet-beta.solana.com:80/rpc'")
t.Skip("Setup 'RPC_URL' to run test i.e. 'https://api.mainnet-beta.solana.com'")
return
}

Expand All @@ -57,13 +57,12 @@ func TestFetchMarket(t *testing.T) {
func TestStreamOpenOrders(t *testing.T) {
rpcURL := os.Getenv("RPC_URL")
if rpcURL == "" {
t.Skip("Setup 'RPC_URL' to run test i.e. 'ws://api.mainnet-beta.solana.com:80/rpc'")
t.Skip("Setup 'RPC_URL' to run test i.e. 'wss://api.mainnet-beta.solana.com'")
return
}
client, err := ws.Connect(context.Background(), rpcURL)
require.NoError(t, err)

err = StreamOpenOrders(client)
require.NoError(t, err)

}
16 changes: 12 additions & 4 deletions programs/token/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ func TestAccount(t *testing.T) {
}

func TestMint(t *testing.T) {

rpcURL := os.Getenv("RPC_URL")
if rpcURL == "" {
t.Skip("Setup 'RPC_URL' to run test i.e. 'wss://api.mainnet-beta.solana.com'")
return
}
addr := solana.MustPublicKeyFromBase58("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v")
cli := rpc.New("http://api.mainnet-beta.solana.com")
cli := rpc.New(rpcURL)

var m Mint
err := cli.GetAccountDataIn(context.Background(), addr, &m)
Expand All @@ -82,9 +86,13 @@ func TestMint(t *testing.T) {
}

func TestRawMint(t *testing.T) {

rpcURL := os.Getenv("RPC_URL")
if rpcURL == "" {
t.Skip("Setup 'RPC_URL' to run test i.e. 'wss://api.mainnet-beta.solana.com'")
return
}
addr := solana.MustPublicKeyFromBase58("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v")
cli := rpc.New("http://api.mainnet-beta.solana.com")
cli := rpc.New(rpcURL)

resp, err := cli.GetAccountInfo(context.Background(), addr)
// handle `err`
Expand Down

0 comments on commit 77eda9c

Please sign in to comment.