Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPII-1889: Initial review of gpii-webdriver... #1

Merged
merged 116 commits into from Feb 8, 2017

Conversation

the-t-in-rtf
Copy link
Collaborator

See GPII-1889 for details.

… to a non-conflicting name and exposed the original functions.
#
# if you want to change the VMs specifications go to README.md

VAGRANT_VMENV_PATH = `node -e "require('vagrant-vmenv')"`.delete!("\n")
Copy link
Member

Choose a reason for hiding this comment

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

Seems problematic to me. We should just install the module locally as a result of npm install - as well as avoiding the failure due to faulty use of "require" this will also remove the requirement for the funny message. This approach may well of course lead to problems if the "node_modules" directory ends up being aliased inside and outside the VM. One solution to this may be to perform the activity inside a "monorepo" style nested project which simply holds the vagrant-vmenv dependency itself. Either way, this dependency needs to be installed locally, not globally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree with the concerns, and have created a ticket against the QI project, where this needs to be addressed:

https://issues.gpii.net/browse/GPII-2170

@the-t-in-rtf
Copy link
Collaborator Author

Just to comment on the use of the "failing tests" pattern. In this package, I provide a means of retrieving jqUnit results from a browser. I want to test that both failures and successes in the browser are correctly retrieved. Those particular browser tests are meant to visibly fail and be logged within the browser, so it seems like the pass/fail inversion would not be appropriate here.

@the-t-in-rtf
Copy link
Collaborator Author

the-t-in-rtf commented Dec 8, 2016

I have merged the selenium 3.x work with this, which also brings in the ESLint standard configuration. This should ensure that the tests work at least with "vagrant up" on your machine. I am spinning up a Windows VM separately and will confirm that the tests run in a more comparable environment.

@the-t-in-rtf
Copy link
Collaborator Author

I used the Vagrant windows image to confirm that the Chrome tests run in Windows.



gpii.test.webdriver.axs.runAxs = function (axsOptions) {
/* globals axs */
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to see this moved up to the head of the file - given a substantial purpose of these definitions (as well as suppressing the lint warning) is to announce to the reader of a file that it contains global references

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

var fluid = require("infusion");
var gpii = fluid.registerNamespace("gpii");

require("../../../");
Copy link
Member

Choose a reason for hiding this comment

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

These test requires could more intelligibly be replaced by fluid.require("%gpii-webdriver") as well as then becoming resistant to the dir structure being reorganised

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, throughout the tests, including requires of package-relative materials such as test fixtures.

args: ["{that}", "wait", "onWaitComplete", "{arguments}"]
}
}
});
Copy link
Member

Choose a reason for hiding this comment

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

Missing EOL here, as well as a couple of other linting failures in the pull (comma-dangle)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's so bizarre, I shouldn't even be able to commit with lint errors. I must have managed to break my ESLint config in just the right way at just the right time for a previous commit to succeed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.


gpii.tests.webdriver.wait.confirmTimeoutMessage = function (message, expectedText) {
// I have to require this here or the whole suite will time out with "no tests found" errors.
// TODO: Review and discuss with Antranig.
Copy link
Member

Choose a reason for hiding this comment

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

There are two main timeout hazards in the system - firstly the 13ms timeout which is in QUnit https://github.com/fluid-project/infusion/blob/master/tests/lib/qunit/js/qunit.js#L484 - responsible for draining its queue and deciding whether it is empty, and then secondly the 100ms timeout which is in node-jqUnit, determining whether it will attempt to restart - https://github.com/fluid-project/node-jqunit/blob/master/lib/jqUnit-node.js#L209 - we should try to see which of these you are running foul of.

In another context (a similar problem with the IoC testing framework as a whole) I patched an "interlock flag" into our edition of QUnit which will prevent it from exiting in the case some external driver has determined that "tests should be arriving" - https://github.com/fluid-project/infusion/blob/master/tests/lib/qunit/js/qunit.js#L1465 - it's possible that using this flag might be helpful to you

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed the workaround and required jqUnit from the top of the file. The problem is no longer there, so I assume that a) it was the 13ms timeout we were hitting and b) the first for FLUID-5810 is enough for us.

}]
});

// gradeNames: ["fluid.test.testEnvironment"],
Copy link
Member

Choose a reason for hiding this comment

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

stray comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

};

var namespaced = {
fn: function(){ return true; }
Copy link
Member

Choose a reason for hiding this comment

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

If this file could have been linted, the spacing would fail here - I'd say that even these definitions are worth putting in their own file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. In moving this to another file, I ended up namespacing the previously global functions, which made the final check (which tested the use of deeper paths) redundant.

@amb26
Copy link
Member

amb26 commented Dec 8, 2016

Current state of the pull looks very good and I was able to run the tests without problems. Looks like just a last few bits of snagging

@the-t-in-rtf
Copy link
Collaborator Author

@amb26, the latest feedback has been addressed.

@amb26 amb26 merged commit cab5e9d into fluid-project:master Feb 8, 2017
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.

None yet

2 participants