-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Labels
Description
Description
Now, for example, if we pass an empty string in an environment variable for a key that implies a boolean value and is parsed through JSON.parse, we get an unreadable error: “Uncaught SyntaxError: Unexpected end of JSON input".
Error should be readable and should include "what variable was it, what value was it"
Probably it should be fixed in https://github.com/gemini-testing/configparser
Verify latest release
- I verified that the issue exists in the latest Testplane release
Testplane version
No response
Last Testplane version that worked
No response
Which area(s) of Testplane are affected? (leave empty if unsure)
Configuration
Link to the code that reproduces this issue or a replay of the bug
No response
Reproduction steps
- Attach any of our plugins (for example, html-reporter)
- Overwrite json value with invalid env variable (for example, html_reporter_enabled)
html_reporter_enabled=invalid npx testplane
Actual Behavior
We get error like:
[13:28:23 +0300] Unhandled Rejection in testplane:master:42579:
Promise: Promise {
<rejected> SyntaxError: Unexpected token i in JSON at position 0
at parse (<anonymous>)
at /Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/core.js:25:21
at /Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/core.js:68:26
at Object.get [as enabled] (/Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/lazy.js:27:25)
at /Users/kroman512/clean/minimal-testplane/node_modules/lodash/lodash.js:2730:27
at arrayEach (/Users/kroman512/clean/minimal-testplane/node_modules/lodash/lodash.js:530:11)
at baseClone (/Users/kroman512/clean/minimal-testplane/node_modules/lodash/lodash.js:2727:7)
at Function.cloneDeep (/Users/kroman512/clean/minimal-testplane/node_modules/lodash/lodash.js:11156:14)
at forceParsing (/Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/lazy.js:16:14)
at /Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/core.js:105:16
}
Reason: SyntaxError: Unexpected token i in JSON at position 0
at parse (<anonymous>)
at /Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/core.js:25:21
at /Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/core.js:68:26
at Object.get [as enabled] (/Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/lazy.js:27:25)
at /Users/kroman512/clean/minimal-testplane/node_modules/lodash/lodash.js:2730:27
at arrayEach (/Users/kroman512/clean/minimal-testplane/node_modules/lodash/lodash.js:530:11)
at baseClone (/Users/kroman512/clean/minimal-testplane/node_modules/lodash/lodash.js:2727:7)
at Function.cloneDeep (/Users/kroman512/clean/minimal-testplane/node_modules/lodash/lodash.js:11156:14)
at forceParsing (/Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/lazy.js:16:14)
at /Users/kroman512/clean/minimal-testplane/node_modules/html-reporter/node_modules/gemini-configparser/lib/core.js:105:16
Expected Behavior
human-readable error, from which it would be clear that "html_reporter_enabled" env variable value is the issue
Which Node.js version are you using?
20.11.0
Internal issue: https://nda.ya.ru/t/4PWRys2Q7JhGvW
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Backlog