Skip to content

GPII-2141: Add tests for the device reporter (was: GPII-1310: Add gpii.deviceReporter.alwaysInstalled)#407

Open
javihernandez wants to merge 9 commits intoGPII:masterfrom
javihernandez:GPII-1310
Open

GPII-2141: Add tests for the device reporter (was: GPII-1310: Add gpii.deviceReporter.alwaysInstalled)#407
javihernandez wants to merge 9 commits intoGPII:masterfrom
javihernandez:GPII-1310

Conversation

@javihernandez
Copy link
Copy Markdown
Member

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.

@javihernandez
Copy link
Copy Markdown
Member Author

This is not ready to land master yet, it's missing tests for gpii.deviceReporter.live.get.
In any case, this can be used by @sgithens in order for him to keep working on the windows' dynamic device reporter and, in my opinion, is safe enough to be merged it into the review4 branch.

javihernandez and others added 2 commits November 5, 2015 13:22
Also, stopped using our own mockPlatformReporter in favour of the already existant one under our testing framework.
@javihernandez
Copy link
Copy Markdown
Member Author

Ok, I've started adding support for deviceReporter's live get function, but I'm a bit confused.
Right now I'm getting this error:

Failed to resolve reference {flowManager}.solutionsRegistryDataSource - could not match context with name flowManager from component { typeName: \"gpii.deviceReporter.live\" gradeNames: [\"gpii.deviceReporter.dev\",\"kettle.urlExpander.distributeDevVariables\",\"gpii.deviceReporter.live\",\"gpii.deviceReporter.base\",\"kettle.app\"] id: byrbhsem-110}

This is because the deviceReporter is expecting to have a flowManager.solutionsRegistryDataSource component in place as stated here.
My question is, how can I supply that component? Can I do that without the need of a complete flowManager? Is this a problem in the deviceReporter implementation? Any advice will be appreciated.

@amb26
Copy link
Copy Markdown
Member

amb26 commented Nov 12, 2015

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.

@javihernandez
Copy link
Copy Markdown
Member Author

Ok, thanks for taking a look at it, will wait then.
Cheers!

@klown
Copy link
Copy Markdown
Member

klown commented Nov 13, 2015

@amb26 @javihernandez
Antranig wrote:

The raw reference to the flowManager from the deviceReporter is an implementation error in the deviceReporter

The processReporter sports the same error. I'll stay tuned, and fix it when I see what you do.
(Note: the processReporter work is not in any GPII branches -- nothing for you to eliminate).

@kaspermarkus
Copy link
Copy Markdown
Member

Should be updated with #425 - and merged in once pull/425 is in

@kaspermarkus
Copy link
Copy Markdown
Member

@javihernandez @amb26 has this been merged and github is just slow at realizing this, or..?

@amb26
Copy link
Copy Markdown
Member

amb26 commented Jun 17, 2016

@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

@javihernandez
Copy link
Copy Markdown
Member Author

javihernandez commented Jun 23, 2016

@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
  ...
@gpii-bot
Copy link
Copy Markdown

CI job passed.

@gpii-bot
Copy link
Copy Markdown

CI job passed.

@javihernandez
Copy link
Copy Markdown
Member Author

@amb26,

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?

@gpii-bot
Copy link
Copy Markdown

CI job passed.

1 similar comment
@gpii-bot
Copy link
Copy Markdown

CI job passed.

@gpii-bot
Copy link
Copy Markdown

CI job passed.

@javihernandez javihernandez changed the title GPII-1310: Added gpii.deviceReporter.alwaysInstalled GPII-1310: Add tests for the device reporter (was: Added gpii.deviceReporter.alwaysInstalled) Nov 16, 2016
@javihernandez javihernandez changed the title GPII-1310: Add tests for the device reporter (was: Added gpii.deviceReporter.alwaysInstalled) GPII-2141: Add tests for the device reporter (was: Added gpii.deviceReporter.alwaysInstalled) Nov 16, 2016
@javihernandez javihernandez changed the title GPII-2141: Add tests for the device reporter (was: Added gpii.deviceReporter.alwaysInstalled) GPII-2141: Add tests for the device reporter (was: GPII-1310: Add gpii.deviceReporter.alwaysInstalled) Nov 16, 2016
@javihernandez
Copy link
Copy Markdown
Member Author

@amb26 I've just discovered this pull request that I think that would be great to merge before @klown's #461 gets in.
Since this pull request was already in place (for GPII-1310) I've just created GPII-2141 and updated the title according to the new JIRA number. I'm updating this with current master, I'll let you know when it's ready for review.

* 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
  ...
@gpii-bot
Copy link
Copy Markdown

CI job passed.

@javihernandez
Copy link
Copy Markdown
Member Author

@amb26 this is ready for review again.

@gtirloni
Copy link
Copy Markdown
Contributor

gtirloni commented Feb 3, 2017

ok to test

@gpii-bot
Copy link
Copy Markdown

gpii-bot commented Feb 3, 2017

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.
  ...
@gpii-bot
Copy link
Copy Markdown

CI job passed.

@kaspermarkus kaspermarkus self-assigned this Jun 27, 2017

"use strict";

var fluid = require("universal"),
Copy link
Copy Markdown
Member

@kaspermarkus kaspermarkus Aug 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be var fluid = require("infusion"),

Copy link
Copy Markdown
Member

@kaspermarkus kaspermarkus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...sigh, this cost me half an hour of browsing old commodore games :)

},
events: {
onSuccess: null
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention "static"

args: ["{arguments}.0", "{that}.options.expectedGetResult"]
}]
}, {
name: "Device Reporter tests",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"live" or "dynamic" should be in the name

port: 8081
});

gpii.tests.deviceReporter.staticExpectedPayload = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is used by both static and live tests, the name is a bit misleading.. prob. just "expectedPayload"

"expectInstalled": [
"rainbowIslands",
"barbarian",
"greenBeret"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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": [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants