GPII-2141: Add tests for the device reporter (was: GPII-1310: Add gpii.deviceReporter.alwaysInstalled)#407
GPII-2141: Add tests for the device reporter (was: GPII-1310: Add gpii.deviceReporter.alwaysInstalled)#407javihernandez wants to merge 9 commits intoGPII:masterfrom
Conversation
|
This is not ready to land master yet, it's missing tests for gpii.deviceReporter.live.get. |
Also, stopped using our own mockPlatformReporter in favour of the already existant one under our testing framework.
|
Ok, I've started adding support for deviceReporter's live get function, but I'm a bit confused. This is because the deviceReporter is expecting to have a flowManager.solutionsRegistryDataSource component in place as stated here. |
|
Hi Javi - It will be better for this work to wait until my upcoming branch is ready since it will need to be merged up in any case. The raw reference to the flowManager from the deviceReporter is an implementation error in the deviceReporter - I'll make sure to eliminate it in my branch. |
|
Ok, thanks for taking a look at it, will wait then. |
|
@amb26 @javihernandez
The processReporter sports the same error. I'll stay tuned, and fix it when I see what you do. |
|
Should be updated with #425 - and merged in once pull/425 is in |
|
@javihernandez @amb26 has this been merged and github is just slow at realizing this, or..? |
|
@kaspermarkus - no, it has not been merged - you may be misreading your comment of Jan 20 of "Should be updated" as "Should already be updated" rather than "Should be updated in the future" : P |
well, @kaspermarkus is half-right, since part of it has been merged in, see: https://github.com/GPII/universal/blob/master/gpii/node_modules/deviceReporter/src/DeviceReporterUtilities.js#L30-L37 |
* upstream/master: (213 commits)
Increase video memory from 128MB to 256MB
GPII-1854 - Disable 3D acceleration
GPII-1855 - Upgrade to Fedora 24
GPII-1848: Moved node-jqunit into top-level dependencies and updated express-handlebars to current to remove deprecation and vulnerability warning
GPII-1848: Moved up to grunt 1.x toolchain, eliminated dependency on grunt-gpii, moved up to ESlint linting
GPII-679: Corrects license link from kettle to universal repo.
GPII-679: Moves EC funding acknowledgement below license statement.
GPII-1811: Updates Vagrant VM to Fedora 23.
Comply with new LTS/Current split.
GPII-1318: Upgrades to 1.0.0 release version of Kettle.
GPII-1318: Updates Dockerfile to Node 4.4.3.
GPII-1318: Updates to latest dev releases of Kettle and Infusion. Removes obsolete instructions from README about deduping Infusion.
GPII-1556: Removed support for the old style preferences. Here 'old-style' preferences refer to the ones used in the early stages of cloud4all and retrieved at the /oldPreferences/* URL.
GPII-1318: Final fixes for ontologyHandler tests, incorporating FLUID-5908 fix for selection tree
GPII-1318: Fully repaired all node-based tests and production config tests, updated to trunk versions of Kettle and Infusion
GPII-1318: Fixed errors uncovered from assertDeepEq now differentiating between undefined and {}. Also a minor fix due to a change in semantics of the model transformation framework which causes the 'output' of a quantize to be interpreted as a transform by default
GPII-1318: Final correction to settleStructure algorithm
GPII-1318: Support for settingsHandlers which have asynchronous getSettings operation, in order to support corrected implementation of ORCA settings handler in Linux repository
GPII-1318: Updated .jshintignore for browerChannelClient
GPII-1794: Updated .jshintignore for added sample
...
|
CI job passed. |
|
CI job passed. |
|
just added a few tests for the deviceReporter. Right now I'm testing that both static and live device reporters are configured according to a given configuration and that they work as expected. Indirectly, I'm also testing that the gpii.deviceReporter.alwaysInstalled works fine by making use of it in the mocked solutions registry used for the live tests. Is there anything else you would like to add tests for? |
|
CI job passed. |
1 similar comment
|
CI job passed. |
|
CI job passed. |
|
@amb26 I've just discovered this pull request that I think that would be great to merge before @klown's #461 gets in. |
* upstream/master: (77 commits) GPII-2110: Added JSON5 linting task GPII-1840: Corrected spelling of "minuscule" GPII-1840 Moving hash incrementing house keeping to a record structure with the hash being built and it's count size. GPII-2110: Updated kettle version and JSON5 dependency in package.json, which means we're now JSON 5 compatible. Updated solution registry files to be of type JSON 5 Switch Dockerfile from 'current't to 'lts' node GPII-2109: Removed chrome plugin from static device reporter as suggest by Javi GPII-1840 Updating function doc formatting for entire file. GPII-1840 Adding test for disconnected paths GPII-1840 Changing wording from vertice to vertex. GPII-2060 - Bind mount node_modules in /var/tmp Switch from 'current' to 'lts' GPII-2109: Google chrome now never reports as being installed when using the dynamic device reporter GPII-1000: Updated JournalIntegrationTests GPII-1000: Removed 'update' block from solutions registry entry GPII-1999: Added solution description file for Read&Write Gold GPII-1999: Added acceptance tests for Read&Write Gold GPII-1999: Updated windows-dynamicDeviceReporter tests for RWG GPII-1999: Updating lifecycle actions for Read&Write Gold GPII-1999: Fixed the 'isInstalled' block in the solutions registry GPII-2088 - More details about where application is installed ...
|
CI job passed. |
|
@amb26 this is ready for review again. |
|
ok to test |
|
CI job passed. |
* upstream/master: (209 commits) GPII-2104: Updated easyone's URL in the solutions registry GPII-2283: Updates to logging payloads following review GPII-2283: Adjustment of logging payloads in advance of HST GPII-2146: Linting fix GPII-2160: Updates to line lengths following review GPII-2160: Updates to line length and commenting following review GPII-2259: Pushing further updates through GPII-2235: Minor tidying GPII-2235: Unit test improvements GPII-2235: Added single instance detection to flowManager lifecycle GPII-2259: Updated the extraneous copies of Infusion client code that the tests depend on to the matching release of Infusion GPII-2259: Minor dependency update for universal to latest infusion, express, oauth2orize etc. GPII-2235: Added component destruction GPII-2235: Tarted up the unit tests. GPII-2235: Added clarity for 0 pid. GPII-2235: Moved pidFile path generation code into function, and disposing component. GPII-2235: Ensures there's only one instance of GPII GPII-2160: Fix and test case for failure to continue with journal restore actions if one results in a failure GPII-252: Add support for highContrastTheme GPII-2146 Addressing comments from PR. Factoring out querying of kettle.configs, changing API casing, and fixing up js docs. ...
|
CI job passed. |
|
|
||
| "use strict"; | ||
|
|
||
| var fluid = require("universal"), |
There was a problem hiding this comment.
should be var fluid = require("infusion"),
kaspermarkus
left a comment
There was a problem hiding this comment.
Looks good, Javi... Left some relatively minor comments in this fancy new github review mode (by accident)
| kettle = require("kettle"), | ||
| gpii = fluid.registerNamespace("gpii"); | ||
|
|
||
| require("universal"); |
There was a problem hiding this comment.
Prob not that important, but in the name of progress and more stable resolving this could be changed to
fluid.require("%universal");
| "id": "com.commodore.rainbowIslands" | ||
| }, | ||
| { | ||
| "id": "com.commodore.barbarian" |
There was a problem hiding this comment.
...sigh, this cost me half an hour of browsing old commodore games :)
| }, | ||
| events: { | ||
| onSuccess: null | ||
| }, |
There was a problem hiding this comment.
Is there a reason for explicitly saying that you're not handling an onSuccess event in the testCase ... else this block should be removed
| }; | ||
|
|
||
| var testDefs = [{ | ||
| name: "Device Reporter tests", |
| args: ["{arguments}.0", "{that}.options.expectedGetResult"] | ||
| }] | ||
| }, { | ||
| name: "Device Reporter tests", |
There was a problem hiding this comment.
"live" or "dynamic" should be in the name
| port: 8081 | ||
| }); | ||
|
|
||
| gpii.tests.deviceReporter.staticExpectedPayload = { |
There was a problem hiding this comment.
Since this is used by both static and live tests, the name is a bit misleading.. prob. just "expectedPayload"
| "expectInstalled": [ | ||
| "rainbowIslands", | ||
| "barbarian", | ||
| "greenBeret" |
There was a problem hiding this comment.
This is up to you, but perhaps change this to a JSON 5 file, and explicitly comment out the greenBeret solution describing that this is reported via alwaysInstalled - so it's clear that you're testing that functionality
| }, | ||
| "deviceReporters": { | ||
| "gpii.packageKit.find": { | ||
| "expectInstalled": [ |
There was a problem hiding this comment.
I find the "expectInstalled" wildly misleading - since this is rather what we "report as installed"... But looking at the acceptance tests, I can see that the reason for this naming, since in the case of acceptance tests these are indeed what we expect to be installed... I might give you and Bosmon a ping in the channel when you're both there to discuss if we can do something clever.. But the actual changes can be done here: #494 and doesn't need to be adressed in this pull request
This new function is meant to be used by solutions that are built-in and need to tell the live device reporter that they are always installed.
Also, we're taking account of this into our integration testing framework so we don't break tests.