-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Some ClouderyView tests take too much time on the CI and then timeout. They have been deactivated but we should find a way to make them pass without timeout.
When done we should revert #750
The issue is that some tests take ~20x longer on CI than on local development environment.
For example the following test
import { Button as MockButton } from 'react-native'
const ClouderyView = ({ setInstanceData }) => {
return (
<>
<MockButton
testID="triggerStartLoadWithRequest"
onPress={() => {
console.timeEnd("🌈 ClickHandler")
setInstanceData({
instance: 'https://some_existing_instance.mycozy.cloud/',
fqdn: 'some_existing_instance.mycozy.cloud'
})
}}
title="WebView Button"
/>
</>
)
}
it('should listen for redirection and intercept login data for login view', async () => {
console.time("🌈 EntireTest")
console.time("🌈 RenderComponent")
const { getByTestId } = render(<ClouderyView {...props} />)
console.timeEnd("🌈 RenderComponent")
console.time("🌈 Find & ClickButton")
const button = getByTestId('triggerStartLoadWithRequest')
console.timeEnd("🌈 Find & ClickButton")
console.time("🌈 ClickHandler")
console.time("🌈 WaitFor")
await waitFor(() => fireEvent.press(button))
console.timeEnd("🌈 WaitFor")
// Then
expect(props.setInstanceData).toHaveBeenCalledTimes(1)
expect(props.setInstanceData).toHaveBeenCalledWith({
instance: 'https://some_existing_instance.mycozy.cloud/',
fqdn: 'some_existing_instance.mycozy.cloud'
})
console.timeEnd("🌈 EntireTest")
})Would produce the following log when run on GH Action CI:
🌈 RenderComponent: 8857 ms
🌈 Find & ClickButton: 1 ms
🌈 ClickHandler: 936 ms
🌈 WaitFor: 946 ms
🌈 EntireTest: 9808 ms
On my computer the entire test would fit in less than 400ms
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels