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-1336: update schemaMiddleware to work with more than just POST data... #5

Merged
merged 198 commits into from
Feb 8, 2017

Conversation

the-t-in-rtf
Copy link
Collaborator

See GPII-1336 for details.

duhrer added 30 commits August 20, 2015 16:25
…ee `README.md` for details about the list of components and their purpose.
…scapes slashes and tildes in path variables.
…Z-Schema improvements (and advice from the package author).
…e schema directory. Also added test content to exercise this.
… required there and breaks things on the server side.
…hould include information about the JSON schema it uses.
…ter logging when an invalid schema is supplied.
… `validator` output using hints from the schema itself.
@the-t-in-rtf
Copy link
Collaborator Author

When we get around to this, we should review all-tests.js together. All of the tests required from all-tests.js pass individually, but fail when run together. I suspect a similar problem in gpii-express-user as well.

…d dependencies based on output of `yarn outdated`.
…pendencies based on output of `yarn outdated`.
@the-t-in-rtf
Copy link
Collaborator Author

@amb26, once the gpii-pouchdb pull is merged, it would be good to revisit this one. It's one of the very oldest, and seemed to be trending towards completion when last we left it. I will start working on the test stability in advance of that.

…requirements, and to document the test problems with npm 3.10.10
@the-t-in-rtf
Copy link
Collaborator Author

@amb26, after painstaking troubleshooting, I have confirmed that the test failures only occur when running the tests using npm test, and only with npm version 3.10.10. The tests definitely pass when using a 4.x version of npm, and pass with yarn as well. As I have no idea how to localize the problem beyond that, I hope it's acceptable to document the incompatibility and let time take care of the rest. The tests pass in Vagrant, which is configured to use yarn.

@amb26
Copy link
Member

amb26 commented Feb 6, 2017

I get the following failure when running the tests by any means:

$ yarn test
yarn test v0.19.1
$ node node_modules/.bin/istanbul cover tests/all-tests.js
E:\source\gits\gpii-json-schema\node_modules\.bin\istanbul:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
error Command failed with exit code 1.

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

OK, I fixed the problem that was preventing the launch of istanbul, but that only cleared the way to hit the next problem.

I'm currently encountering "address in use" errors not seen on linux or OS X, but only when running the browser tests (they use the same harness as the node tests). I will continue investigating and comment here when I have more information.

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

The "address in use" errors were a red herring (although they did encourage me to do a bit of review and refactoring of the test environments, which isn't a bad thing). It turns out that my problem was that chromedriver wasn't in the path on my windows VM. @amb26, as far as I can see, this is ready for review again.

@amb26
Copy link
Member

amb26 commented Feb 7, 2017

I've installed chromedriver using npm install -g chromedriver, and verified that it is on the PATH by running "chromedriver" from the command line. Unfortunately for some reason it is still not being picked up by the tests. I get the following error:

13:16:57.354:  jq: Test concluded - Module "Testing 'evolved' error messages..." Test name "Testing preserving a message in an underlying schema...": 1/1 passed
 - PASS
13:16:57.667:  jq: FAIL: Module "chrome: Testing client-side validation..." Test name "chrome: Validate the simplest valid 'base' record...." - Message: Died on
 test #1     at Object.asyncTest (E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\lib\qunit\js\qunit.js:405:9)
    at E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\test-core\utils\js\IoCTestUtils.js:651:29
    at Object.fluid.each (E:\Source\gits\gpii-json-schema\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Object.fluid.test.processTestCase (E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\test-core\utils\js\IoCTestUtils.js:625:15)
    at E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\test-core\utils\js\IoCTestUtils.js:674:24
    at Object.fluid.each (E:\Source\gits\gpii-json-schema\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Object.fluid.test.processTestCaseHolder (E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\test-core\utils\js\IoCTestUtils. .... [output suppre
ssed at 1024 chars - for more output, increase fluid.logObjectRenderChars]
13:16:57.671:  jq: Source: Error: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://ch
romedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.
    at Error (native)
    at ServiceBuilder (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\chrome.js:191:13)
    at getDefaultService (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\chrome.js:280:22)
    at Function.createSession (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\chrome.js:700:44)
    at createDriver (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\index.js:167:33)
    at Builder.build (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\index.js:639:16)
    at gpii.webdriver.init (E:\Source\gits\gpii-json-schema\node_modules\gpii-webdriver\src\js\webdriver.js:53:35)
    at togo (E:\Source\gits\gpii-json-schema\node_modules\infusion\src\framework\core\js\FluidIoC.js:1794:33)
    at Object.fire  .... [output suppressed at 1024 chars - for more output, increase fluid.logObjectRenderChars]
13:16:57.675:  Express server listening on port 6985
13:16:57.675:  Express started...
13:16:57.783:  jq: Test concluded - Module "chrome: Testing client-side validation..." Test name "chrome: Validate the simplest valid 'base' record....": 0/1 pa
ssed - FAIL
13:16:58.104:  jq: FAIL: Module "chrome: Testing client-side validation..." Test name "chrome: Validate the simplest valid 'derived' record...." - Message: Died
 on test #1     at Object.asyncTest (E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\lib\qunit\js\qunit.js:405:9)
    at E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\test-core\utils\js\IoCTestUtils.js:651:29
    at Object.fluid.each (E:\Source\gits\gpii-json-schema\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Object.fluid.test.processTestCase (E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\test-core\utils\js\IoCTestUtils.js:625:15)
    at E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\test-core\utils\js\IoCTestUtils.js:674:24
    at Object.fluid.each (E:\Source\gits\gpii-json-schema\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Object.fluid.test.processTestCaseHolder (E:\Source\gits\gpii-json-schema\node_modules\infusion\tests\test-core\utils\js\IoCTestUti .... [output suppresse
d at 1024 chars - for more output, increase fluid.logObjectRenderChars]
13:16:58.107:  jq: Source: Error: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://ch
romedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.
    at Error (native)
    at ServiceBuilder (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\chrome.js:191:13)
    at getDefaultService (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\chrome.js:280:22)
    at Function.createSession (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\chrome.js:700:44)
    at createDriver (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\index.js:167:33)
    at Builder.build (E:\Source\gits\gpii-json-schema\node_modules\selenium-webdriver\index.js:639:16)
    at gpii.webdriver.init (E:\Source\gits\gpii-json-schema\node_modules\gpii-webdriver\src\js\webdriver.js:53:35)
    at togo (E:\Source\gits\gpii-json-schema\node_modules\infusion\src\framework\core\js\FluidIoC.js:1794:33)
    at Object.fire  .... [output suppressed at 1024 chars - for more output, increase fluid.logObjectRenderChars]
13:16:58.111:  FATAL ERROR: Uncaught exception: listen EADDRINUSE :::6985

@amb26
Copy link
Member

amb26 commented Feb 7, 2017

Looks like selenium-webdriver's detection of chromedriver is bullshit - it looks explicitly for "chromedriver.exe" in the path - https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/chrome.js#L189 - whereas npm install -g chromedriver only places "chromedriver" and "chromedriver.cmd" on the PATH

@amb26
Copy link
Member

amb26 commented Feb 7, 2017

I've filed giggio/node-chromedriver#90 against node-chromedriver. I suggest we just add a brief note in the README under the "chromedriver" heading that this npm module is not to be used and that the user must manually follow the install instructions at https://sites.google.com/a/chromium.org/chromedriver/getting-started to download this to their PATH

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

I have updated the README with caveats about the chromedriver install. Thankfully this is no longer needed on the Vagrant linux box, which now finally has its own package.

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

I also removed the dev dependency on the chromedriver npm package.

@amb26 amb26 merged commit 71db4cf into fluid-project:master Feb 8, 2017
@the-t-in-rtf the-t-in-rtf deleted the GPII-1336 branch May 22, 2017 07:31
@the-t-in-rtf the-t-in-rtf restored the GPII-1336 branch September 27, 2017 09:27
@the-t-in-rtf the-t-in-rtf deleted the GPII-1336 branch October 10, 2017 07:29
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.

4 participants