-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: reduce flaky tests #1266
test: reduce flaky tests #1266
Conversation
29bbd60
to
76bb171
Compare
describe('Superfluid framework', () => { | ||
it.each([ | ||
{ network: 'goerli' }, | ||
{ network: 'matic' }, | ||
// { network: 'xdai' }, | ||
{ network: 'optimism' }, | ||
{ network: 'avalanche' }, | ||
{ network: 'arbitrum-one' }, | ||
] as Array<{ network: CurrencyTypes.EvmChainName }>)( | ||
'Should initialize superfluid framework on $network', | ||
async ({ network }) => { | ||
const provider = getDefaultProvider(network); | ||
const networkValidRequest = { | ||
...validRequest, | ||
currencyInfo: { | ||
...validRequest.currencyInfo, | ||
network, | ||
}, | ||
}; | ||
const sf = await getSuperFluidFramework(networkValidRequest, provider); | ||
expect(sf).toBeDefined(); | ||
}, | ||
); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely not a "unit" test. Considering the flakiness it creates, I'm dropping it and not replacing it.
describeIf(!process.env.CIRCLE_PR_NUMBER && !process.env.DISABLE_API_TESTS, 'Multichain', () => { | ||
// TODO temporary disable xDAI, CELO, Sokol, and Goerli | ||
// FIXME: API-based checks should run nightly and be mocked for CI | ||
[ | ||
'mainnet', | ||
// 'rinkeby', | ||
// 'goerli', | ||
// 'xdai', | ||
// 'sokol', | ||
'fuse', | ||
//'celo', | ||
const infoRetriever = new EthInputDataInfoRetriever( | ||
paymentAddress, | ||
PaymentTypes.EVENTS_NAMES.PAYMENT, | ||
'matic', | ||
'fantom', | ||
].forEach((network) => { | ||
it(`Can get the balance on ${network}`, async () => { | ||
const retriever = new EthInputDataInfoRetriever( | ||
'0xc12F17Da12cd01a9CDBB216949BA0b41A6Ffc4EB', | ||
PaymentTypes.EVENTS_NAMES.PAYMENT, | ||
network, | ||
'9649a1a4dd5854ed', | ||
process.env[`EXPLORER_API_KEY_${network.toUpperCase()}`], | ||
); | ||
await expect(retriever.getTransferEvents()).resolves.not.toThrow(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this test. This is covered by the first test in terms of logic. The rest isn't "unit" test, but integration, and is too flaky. This is an obsolete feature and doesn't deserve the effort imo
d30f9c0
to
d27db26
Compare
...args: [string | number | Function | jest.FunctionLike, jest.EmptyFunction] | ||
) => (condition ? describe(...args) : describe.skip(...args)); | ||
it('can detect a MATIC payment to self', async () => { | ||
// NB: The from and to are the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might just be me but I always get tripped up by the NB acronym for Nota Bene. I think "Note" would be more clear.
// NB: The from and to are the same | |
// Note: The from and to are the same |
Co-authored-by: Alexandre ABRIOUX <alexandre-abrioux@users.noreply.github.com>
9dec3a3
to
a2642ac
Compare
Resolves #1092
Based on CircleCI insights
Remove unnecessary flaky tests
Replace network calls by mocks
Increase timeouts
Replaced BTC by USD if relevant (for the record, BTC was the only supported currency at first, but now it's legacy and uses an inefficient balance detector)