Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

refactor(samples): convert sample tests from ava to mocha #186

Merged
merged 9 commits into from
Nov 23, 2018

Conversation

nareshqlogic
Copy link
Contributor

Fixes convert all sample tests from ava to mocha #2865 (it's a good idea to open an issue first for discussion)

  • Tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 19, 2018
@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 19, 2018
@kokoro-team kokoro-team removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 19, 2018
@codecov
Copy link

codecov bot commented Nov 20, 2018

Codecov Report

Merging #186 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #186   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines           4      4           
=====================================
  Hits            4      4

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 818f10d...425039d. Read the comment docs.

@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 20, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 20, 2018
@JustinBeckwith
Copy link
Contributor

System tests still failing:

  1) should require all-or-none of {contextField, wrappedKey, keyName}
(node:119) UnhandledPromiseRejectionWarning: Error: Command failed: node deid.js deidDateShift "resources/dates.csv" "/tmpfs/src/github/nodejs-dlp/samples/system-test/temp.result.csv" 30 30 birth_date register_date -f name -n projects/nodejs-docs-samples/locations/global/keyRings/integration-tests-dlp/cryptoKeys/test-key
/tmpfs/src/github/nodejs-dlp/samples/node_modules/yargs/yargs.js:1148
      else throw err
           ^
Error: You must set either ALL or NONE of {contextFieldId, keyName, wrappedKey}!
    at deidentifyWithDateShift (/tmpfs/src/github/nodejs-dlp/samples/deid.js:188:11)
    at Object.require.demand.command.command.command.command.opts [as handler] (/tmpfs/src/github/nodejs-dlp/samples/deid.js:515:7)
    at Object.runCommand (/tmpfs/src/github/nodejs-dlp/samples/node_modules/yargs/lib/command.js:238:44)
    at Object.parseArgs [as _parseArgs] (/tmpfs/src/github/nodejs-dlp/samples/node_modules/yargs/yargs.js:1063:30)
    at Object.get [as argv] (/tmpfs/src/github/nodejs-dlp/samples/node_modules/yargs/yargs.js:1004:21)
    at Object.<anonymous> (/tmpfs/src/github/nodejs-dlp/samples/deid.js:549:22)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at ChildProcess.exithandler (child_process.js:276:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:119) 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: 2)
(node:119) [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.

...

  67 passing (4m)
  7 pending
  1 failing
  1) should require all-or-none of {contextField, wrappedKey, keyName}:
     TypeError [ERR_INVALID_ARG_TYPE]: The "block" argument must be of type function. Received type object
      at innerThrows (assert.js:629:11)
      at Function.throws (assert.js:662:3)
      at Context.it (system-test/deid.test.js:169:16)
npm ERR! Test failed.  See above for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @google-cloud/dlp@0.9.0 samples-test: `cd samples/ && npm link ../ && npm test && cd ../`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @google-cloud/dlp@0.9.0 samples-test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@nareshqlogic
Copy link
Contributor Author

Hi @JustinBeckwith,
I am unable to see log file for test failure. It will be helpful if I can see log file.Thanks.
logfilenotfound

@JustinBeckwith
Copy link
Contributor

@nareshqlogic are you able to run the tests locally?

@nareshqlogic
Copy link
Contributor Author

Hi @JustinBeckwith ,
I am not able to run all the tests successfully. As I am getting some errors like 'Error: 7 PERMISSION_DENIED: Not allowed, access denied for permission dlp.jobs.create'.
Although most of tests are running successfully.

@JustinBeckwith JustinBeckwith merged commit 1ca3675 into googleapis:master Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants