Skip to content

Commit

Permalink
test: rewrite tests to target latest validator, as of today (#1534)
Browse files Browse the repository at this point in the history
# Summary

The only reason these tests succeed is:

1. You're running 1.17.x locally
2. That test result gets cached in Turborepo

Rather, we should all be running the same validator as is running in CI.

In this PR, we eliminate all of the tested values that are not yet present in 1.14.

# Test Plan

```
pnpm test:live-with-test-validator:setup
pnpm turbo test:unit:node --force
```
  • Loading branch information
steveluscher authored Aug 23, 2023
1 parent 71ce0c2 commit ec2d4a4
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe('getAccountInfo', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
}),
});
});
Expand Down Expand Up @@ -176,7 +175,6 @@ describe('getAccountInfo', () => {
type: 'lookupTable',
}),
program: 'address-lookup-table',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -204,7 +202,6 @@ describe('getAccountInfo', () => {
type: 'program',
}),
program: 'bpf-upgradeable-loader',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -233,7 +230,6 @@ describe('getAccountInfo', () => {
type: 'validatorInfo',
}),
program: 'config',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -262,7 +258,6 @@ describe('getAccountInfo', () => {
type: 'stakeConfig',
}),
program: 'config',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -292,7 +287,6 @@ describe('getAccountInfo', () => {
type: 'initialized',
}),
program: 'nonce',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -324,7 +318,6 @@ describe('getAccountInfo', () => {
type: 'mint',
}),
program: 'spl-token',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -361,7 +354,6 @@ describe('getAccountInfo', () => {
type: 'account',
}),
program: 'spl-token',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -392,7 +384,6 @@ describe('getAccountInfo', () => {
type: 'multisig',
}),
program: 'spl-token',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -425,7 +416,6 @@ describe('getAccountInfo', () => {
type: 'mint',
}),
program: 'spl-token-2022',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -454,7 +444,6 @@ describe('getAccountInfo', () => {
type: 'delegated',
}),
program: 'stake',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -484,7 +473,6 @@ describe('getAccountInfo', () => {
type: 'rent',
}),
program: 'sysvar',
space: expect.any(BigInt),
}),
}),
});
Expand Down Expand Up @@ -520,7 +508,6 @@ describe('getAccountInfo', () => {
type: 'vote',
}),
program: 'vote',
space: expect.any(BigInt),
}),
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ describe('getMultipleAccounts', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
});
});
});
Expand Down Expand Up @@ -101,7 +100,6 @@ describe('getMultipleAccounts', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
});
expect(multipleAccounts.value[1]).toBeNull();
});
Expand Down Expand Up @@ -224,7 +222,6 @@ describe('getMultipleAccounts', () => {
type: 'lookupTable',
}),
program: 'address-lookup-table',
space: expect.any(BigInt),
}),
});
});
Expand All @@ -250,7 +247,6 @@ describe('getMultipleAccounts', () => {
type: 'program',
}),
program: 'bpf-upgradeable-loader',
space: expect.any(BigInt),
}),
});
});
Expand All @@ -277,7 +273,6 @@ describe('getMultipleAccounts', () => {
type: 'validatorInfo',
}),
program: 'config',
space: expect.any(BigInt),
}),
});
});
Expand All @@ -304,7 +299,6 @@ describe('getMultipleAccounts', () => {
type: 'stakeConfig',
}),
program: 'config',
space: expect.any(BigInt),
}),
});
});
Expand Down Expand Up @@ -332,7 +326,6 @@ describe('getMultipleAccounts', () => {
type: 'initialized',
}),
program: 'nonce',
space: expect.any(BigInt),
}),
});
});
Expand Down Expand Up @@ -362,7 +355,6 @@ describe('getMultipleAccounts', () => {
type: 'mint',
}),
program: 'spl-token',
space: expect.any(BigInt),
}),
});
});
Expand Down Expand Up @@ -397,7 +389,6 @@ describe('getMultipleAccounts', () => {
type: 'account',
}),
program: 'spl-token',
space: expect.any(BigInt),
}),
});
});
Expand Down Expand Up @@ -426,7 +417,6 @@ describe('getMultipleAccounts', () => {
type: 'multisig',
}),
program: 'spl-token',
space: expect.any(BigInt),
}),
});
});
Expand Down Expand Up @@ -457,7 +447,6 @@ describe('getMultipleAccounts', () => {
type: 'mint',
}),
program: 'spl-token-2022',
space: expect.any(BigInt),
}),
});
});
Expand All @@ -484,7 +473,6 @@ describe('getMultipleAccounts', () => {
type: 'delegated',
}),
program: 'stake',
space: expect.any(BigInt),
}),
});
});
Expand Down Expand Up @@ -512,7 +500,6 @@ describe('getMultipleAccounts', () => {
type: 'rent',
}),
program: 'sysvar',
space: expect.any(BigInt),
}),
});
});
Expand Down Expand Up @@ -546,7 +533,6 @@ describe('getMultipleAccounts', () => {
type: 'vote',
}),
program: 'vote',
space: expect.any(BigInt),
}),
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('getProgramAccounts', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
}),
pubkey: expect.any(String),
});
Expand Down Expand Up @@ -94,7 +93,6 @@ describe('getProgramAccounts', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
}),
pubkey: expect.any(String),
});
Expand All @@ -105,7 +103,6 @@ describe('getProgramAccounts', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
}),
pubkey: expect.any(String),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ describe('getTokenAccountsByDelegate', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
},
pubkey: expect.any(String),
},
Expand Down Expand Up @@ -158,7 +157,6 @@ describe('getTokenAccountsByDelegate', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
}),
}),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ describe('getTokenAccountsByOwner', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
},
pubkey: expect.any(String),
},
Expand Down Expand Up @@ -158,7 +157,6 @@ describe('getTokenAccountsByOwner', () => {
lamports: expect.any(BigInt),
owner: expect.any(String),
rentEpoch: expect.any(BigInt),
space: expect.any(BigInt),
}),
}),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('sendTransaction', () => {
.send();
await expect(resultPromise).rejects.toMatchObject({
code: -32602 satisfies (typeof SolanaJsonRpcErrorCode)['JSON_RPC_INVALID_PARAMS'],
message: expect.stringContaining('expected a valid transaction message version'),
message: expect.stringContaining('invalid value: integer `126`, expected supported versions: [0]'),
name: 'SolanaJsonRpcError',
});
});
Expand Down

0 comments on commit ec2d4a4

Please sign in to comment.