Commit Graph

10 Commits

Author SHA1 Message Date
John Knox
dbb723f8a5 Add FLIPPER_PORTS env var to desktop app
Summary:
Part 3 and final part of adding customizable ports. To use this, the iOS / Android apps have to also be started with the same custom ports.

Example usage: `FLIPPER_PORTS=8189,8188 yarn start`

Reviewed By: passy

Differential Revision: D13801761

fbshipit-source-id: 3dd80a3001ed0855e54cc568fa94eb6fac5fc7f1
2019-01-25 07:24:13 -08:00
John Knox
ecd6935d18 Promisify server starting
Summary:
We had a promise for initializing the servers, but it wasn't rejected when server startup failed.
Fixed by resolving / rejecting based on the listen / error events fired from the server.

Reviewed By: passy

Differential Revision: D13762580

fbshipit-source-id: a0d1a56473f84dc416e5ce2de91a53b21574f452
2019-01-23 05:18:31 -08:00
John Knox
21dfe41fb4 Add sessionId to error messages
Summary: Will allow us to look into bad sessions if necessary.

Reviewed By: passy

Differential Revision: D13695386

fbshipit-source-id: 2cfc8ec28ef4cb387ef7a5a58b02aa77a367ae81
2019-01-17 03:43:16 -08:00
John Knox
3bcb079f87 Define global logger instance to be used for all logging
Summary:
The advantage of this is that anyone can now log without needing to carry around a Logger object.
Primary reason is for making metrics less intrusive in the codebase.

Reviewed By: passy

Differential Revision: D13671368

fbshipit-source-id: 162ab1351a124683aef13983fc3bcec01385cd1a
2019-01-15 09:46:11 -08:00
John Knox
f0262d91f0 Oneworld connectivity test
Summary:
Gets a oneworld device (just android for now), installs an app. Checks it connects and stays connected for 5s.

The app installed is in an array, we just need to add more targets for further tests.

Reviewed By: danielbuechele

Differential Revision: D10231083

fbshipit-source-id: c33fb091c1b7914a33690398a79fd700c445c06c
2018-10-22 11:38:36 -07:00
John Knox
764cdfe127 Move async work out of the Server constructor
Summary:
I feel like doing async stuff here isn't a good idea in general.
But more pressingly, it means you can't immediately call server.close() after new Server(), because the things to close haven't been created yet.

Reviewed By: danielbuechele

Differential Revision: D10488301

fbshipit-source-id: 76ebe91e0c09f353e0bdb9f2e4116757e757abb2
2018-10-22 11:38:36 -07:00
Pritesh Nandgaonkar
ac7980993c FlipperBackgroundPlugin
Summary:
Adds a new type of plugin: `FlipperBackgroundPlugin`
Background plugins are not torn down when the user switches to another plugin so they keep receiving messages in the background.

Background plugins need to use persistedState to keep their data. To handle the messages received in the background they need to implement a static method that merges a message with the current state from redux. The plugin doesn't need to call this method itself, it is called from `client.js`.

```static persistedStateReducer = (
    persistedState: PersistedState,
    data: Object,
  ): PersistedState
```

This method is used to handle messages in both foreground and background.

Reviewed By: danielbuechele

Differential Revision: D10256305

fbshipit-source-id: d86da9caa1b75178841a9a347eb427112141eaa3
2018-10-11 15:23:21 -07:00
John Knox
4d50a5209c Skip failing test until oneworld is shipped
Summary:
The buck install command fails when xcode_dmg is used in sandcastle hosts, meaning xcode is mounted somewhere other than /Applications.
Skip the connection test for now. I'll get oneworld working with it instead.

Reviewed By: passy

Differential Revision: D10231097

fbshipit-source-id: 16e320070f8b3fd4f56ff919bdd3ec47355e342c
2018-10-06 06:12:51 -07:00
John Knox
eebff1eb88 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
2018-10-02 06:57:38 -07:00
Daniel Büchele
5aefb989e0 run jest tests
Summary:
Adding support for JS testing. Currently there are two environments tests can run in: node and electron. To select which environment to run a test in, name your test file accordingly `*.node.js` or `*.electron.js` and put it in a `__tests__` folder.

- `yarn test` to run node based tests
- `yarn test-electron` to run electron tests

A basic snapshot test of the empty app is added to make sure the app is rendering as expected. A test for the server is added to make sure when Flipper is started the two servers (secure and insecure) are started and ready to accept connections.

Reviewed By: passy

Differential Revision: D10050212

fbshipit-source-id: 8ef7f931339b43251d9d423886bcaca99ae691e4
2018-10-02 04:29:51 -07:00