-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add feature to change gitlab server. Closes #87 #88
Add feature to change gitlab server. Closes #87 #88
Conversation
*Update unit, feature and integration tests. *Update README file.
Codecov Report
@@ Coverage Diff @@
## autolabcli-ng #88 +/- ##
============================================
Coverage 100% 100%
============================================
Files 19 19
Lines 417 456 +39
============================================
+ Hits 417 456 +39
Continue to review full report at Codecov.
|
@1AmNegan I downloaded your feature branch, installed and ran the unit tests. The commands I ran are as follows.
The unit tests fail with the following log. $ npm run unit
> [email protected] unit /home/aditya/TSRK/autolabcli
> nyc --reporter=lcov --reporter=text-lcov -s --all mocha 'test/unit/**/*.js'
For application entry point
✓ should start the controller
for eval getInput
✓ should return promise with correct values when flags provided
✓ should return promise with correct values when flags not provided
✓ should not accept empty getInput
✓ should return id provided in options for root user
for init getInput
✓ should return promise with correct values when flags provided
✓ should return promise with correct values when flags not provided
✓ should not accept empty getInput
for prefs input
✓ should send the right event when language is changed using prompt
✓ should send the right event when language is changed using lang flag
✓ should send the right event when invalid language is provided using lang flag
✓ should prompt when type of the server is not provided
✓ should send the right event when main server is changed
✓ should send the right event when gitlab server is changed
✓ should prompt when host is not given for changing main server
✓ should prompt when host is not given for changing gitlab server
✓ should send the appropriate message when invalid host is given for main server
✓ should send the appropriate message when invalid host is given for gitlab server
✓ should send the appropriate message when invalid port is given
✓ should send the appropriate message for show argument
For eval output
✓ should start the spinner when evaluation starts
✓ should draw table for scores event and display total score
✓ should show penalty score when status is not 0
✓ should display error message for invalid event
✓ should display error message for submission_pending event
For exit output
✓ should send logout message on succesful logout
For init output
✓ should send expected welcome text
✓ should start the spinner when authentication starts
✓ should display sucess message for status code as 200
✓ should display error message for invalid credentials
✓ should display appropriate error message for no connection
For prefs output
✓ should send expected output when language is changed
✓ should send expected output when main server is changed
✓ should send expected output when gitlab server is changed
✓ should send expected output when no host is provided
✓ should send expected output when invalid port is provided
✓ should send expected output when invalid language is provided
✓ should draw table for show prefs command
For eval controller
✓ should call the eval action of program with right arguments when command is valid
✓ should NOT proceed for invalid session
For exit controller
✓ should call the action of program with right arguments
✓ should not execute when already exited
For controller entry point
✓ should call the other controllers
For init controller
✓ should call the action of program with right arguments
For prefs controller
✓ should call the prefs action of program with right arguments when command is valid
for evalModel
✓ should work as expected on scores event
✓ should work as expected on invalid event
✓ should work as expected on submission_pending event
for exitModel
✓ should call appropriate methods of preference manager
for initModel
1) should return status code 200 after successful login
2) should return status code of 401 when invalid login provided
3) should return code 4 if unkown error occurs
for prefsModel
✓ should change the language
✓ should change the gitlab server
✓ should change the main server
✓ should send the stored preferences on show
for command validator
✓ should have session validator as expected
✓ should return true for valid session
55 passing (6s)
3 failing
1) for initModel
should return status code 200 after successful login:
Uncaught ExpectationError: Expected start([...]) once (never called)
at Object.fail (node_modules/sinon/lib/sinon/mock-expectation.js:281:25)
at Object.verify (node_modules/sinon/lib/sinon/mock.js:108:29)
at exec (test/unit/index.js:22:22)
at ChildProcess.exithandler (child_process.js:267:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2) for initModel
should return status code of 401 when invalid login provided:
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
3) for initModel
should return code 4 if unkown error occurs:
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
(node:22038) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'currentRetry' of undefined
at /home/aditya/TSRK/autolabcli/node_modules/mocha/lib/runner.js:563:28
at done (/home/aditya/TSRK/autolabcli/node_modules/mocha/lib/runnable.js:301:5)
at /home/aditya/TSRK/autolabcli/node_modules/mocha/lib/runnable.js:365:11
at <anonymous>
(node:22038) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:22038) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! [email protected] unit: `nyc --reporter=lcov --reporter=text-lcov -s --all mocha 'test/unit/**/*.js'`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] unit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/aditya/.npm/_logs/2018-05-08T02_44_46_235Z-debug.log > npm run feature Above command fails with the following log. $ npm run feature
> [email protected] feature /home/aditya/TSRK/autolabcli
> rm -rf ~/.autolabjs && nyc --reporter=lcov --reporter=text-lcov -s --all cucumber-js 'test/feature/features' -r 'test/feature/steps'
- Authenticating you, please wait .................................
Cannot read property 'name' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] feature: `rm -rf ~/.autolabjs && nyc --reporter=lcov --reporter=text-lcov -s --all cucumber-js 'test/feature/features' -r 'test/feature/steps'`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] feature script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/aditya/.npm/_logs/2018-05-08T02_50_03_040Z-debug.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@1AmNegan The code looks good, but there are problems with the tests. I added a detailed comment. Please check.
I have made some minor changes to the tests. Please change the preferences before running the feature tests. |
Requirements
Description of the Change