Skip to content

Commit

Permalink
test: optimized execution
Browse files Browse the repository at this point in the history
  • Loading branch information
n4l5u0r committed Nov 30, 2024
1 parent 402bca5 commit 862056b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
2 changes: 2 additions & 0 deletions tests/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ module.exports = {
testEnvironment: "node",
preset: 'ts-jest',
bail: false,
maxWorkers: 1,
transformIgnorePatterns: ['^.+\\.js$'],
//testMatch: ['**/eth/v4/simple_swap.v4.test.ts','**/eth/v5/swap_on_zero_v4.test.ts','**/eth/v5/multi_swap.test.ts'],
};
13 changes: 13 additions & 0 deletions tests/src/eth/v5/swap_on_uniswap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,24 @@ const devices = [
label: "Nano S",
steps: 9 // <= Define the number of steps for this test case and this device
},
{
name: "nanosp",
label: "Nano S+",
steps: 5 // <= Define the number of steps for this test case and this device
},
{
name: "nanox",
label: "Nano X",
steps: 5 // <= Define the number of steps for this test case and this device
},
{
name: "stax",
label: "Stax",
},
{
name: "flex",
label: "Flex",
},
];

devices.forEach((device) =>
Expand Down
13 changes: 13 additions & 0 deletions tests/src/eth/v5/swap_on_uniswap_fork_2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,23 @@ const devices = [
label: "Nano S",
steps: 7 // <= Define the number of steps for this test case and this device
},
{
name: "nanosp",
label: "Nano S+",
steps: 6 // <= Define the number of steps for this test case and this device
},
{
name: "nanox",
label: "Nano X",
steps: 6 // <= Define the number of steps for this test case and this device
},
{
name: "stax",
label: "Stax",
},
{
name: "flex",
label: "Flex",
}
];

Expand Down
5 changes: 1 addition & 4 deletions tests/src/test.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ beforeAll(async () => {
await Zemu.checkAndPullImage();
});

afterAll(async () => {
await Zemu.stopAllEmuContainers();
});

jest.setTimeout(1000 * 60 * 60);

Expand Down Expand Up @@ -206,7 +203,7 @@ async function processTransaction(eth, sim, steps, label, rawTxHex, srlTx = "")
* @param {string} rawTxHex RawTx Hex to test
* @param {boolean} signed The plugin is already signed and existing in Ledger database
*/
function processTest(device, contractName, testLabel, testDirSuffix, rawTxHex, signed, serializedTx, testNetwork) {
async function processTest(device, contractName, testLabel, testDirSuffix, rawTxHex, signed, serializedTx, testNetwork) {
test(
"[" + contractName + "] - " + device.label + " - " + testLabel,
zemu(device.name, async (sim, eth) => {
Expand Down

0 comments on commit 862056b

Please sign in to comment.