Run wilde on iOS emulator during electron tests

Summary:
Before running the test suite, build wilde and run it on a local emulator.

This takes about 15 mins on a lego-mac with a warm cache.
It's probably worth splitting out the normal unit tests into a separate job, so we get quicker feedback on them. I'll do that in a separate diff.

Lets run this for a while, and see how it goes, I'm wondering if it might get flaky because it will be building the master version of wilde, so potentially could be broken a lot, though it's passed evry time I've tried it so far.

If it's reliable, we can run the same thing with loads of other apps in parallel.

Reviewed By: passy

Differential Revision: D10110408

fbshipit-source-id: 61c549eb1b9d04729dcb5ed01271a484af4777f5
This commit is contained in:
John Knox
2018-10-02 06:54:55 -07:00
committed by Facebook Github Bot
parent 344e6e7a04
commit eebff1eb88

View File

@@ -26,18 +26,31 @@ beforeAll(() => {
test('servers starting at ports', done => {
const serversToBeStarted = new Set([SECURE_PORT, INSECURE_PORT]);
server.addListener('listening', port => {
if (!serversToBeStarted.has(port)) {
done.fail(Error(`unknown server started at port ${port}`));
} else {
serversToBeStarted.delete(port);
}
if (serversToBeStarted.size === 0) {
done();
}
return new Promise((resolve, reject) => {
server.addListener('listening', port => {
if (!serversToBeStarted.has(port)) {
throw Error(`unknown server started at port ${port}`);
} else {
serversToBeStarted.delete(port);
}
if (serversToBeStarted.size === 0) {
done();
resolve();
}
});
});
});
test(
'Layout plugin is connecting',
done => {
server.addListener('new-client', (client: Client) => {
done();
});
},
10000,
);
afterAll(() => {
server.close();
});