-
Notifications
You must be signed in to change notification settings - Fork 2
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
Metadata
Metadata
Assignees
Labels
No labels