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

Getting issue while running lcc report --failed #8

Closed
shivamgarg17 opened this issue Sep 10, 2019 · 8 comments
Closed

Getting issue while running lcc report --failed #8

shivamgarg17 opened this issue Sep 10, 2019 · 8 comments

Comments

@shivamgarg17
Copy link

Please refer the below error
lemoncheesecake[junit,xml]==1.2.0

  • lcc report --failed
    18:06:45 Traceback (most recent call last):
    18:06:45 File "/var/lib/jenkins/workspace/cms-qa/cms-translation-automation/venv/bin/lcc", line 10, in
    18:06:45 sys.exit(main())
    18:06:45 File "/var/lib/jenkins/workspace/cms-qa/cms-translation-automation/venv/local/lib/python2.7/site-packages/lemoncheesecake/cli/main.py", line 49, in main
    18:06:45 return command.run_cmd(cli_args)

18:06:45 return wrap_text(description, int((self.max_width - self._table_overhead) * 0.75))
18:06:45 File "/var/lib/jenkins/workspace/cms-qa/cms-translation-automation/venv/local/lib/python2.7/site-packages/lemoncheesecake/helpers/text.py", line 21, in wrap_text
18:06:45 textwrap.wrap(line, width) for line in text.split("\n")
18:06:45 AttributeError: 'bool' object has no attribute 'split'

@ndelon
Copy link
Contributor

ndelon commented Sep 10, 2019

Hello @shivamgarg17 ,

I guess that you did not copy/paste the full stacktrace, could you do it ?
I will able to provide you a more accurate diagnostic. From my understanding, there was something that you logged (it could be a step description, a message, a check, etc..) where you passed a bool instead of the excepted string.

Best regards.

@shivamgarg17
Copy link
Author

Hi @ndelon ,
Thanks for quick response, I will try to figure out the said steps. Meanwhile please find the full staktrace:
+ lcc report --non-passed Traceback (most recent call last): File "/var/lib/jenkins/workspace/qa/venv/bin/lcc", line 10, in <module> sys.exit(main()) File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/cli/main.py", line 49, in main return command.run_cmd(cli_args) File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/cli/commands/report.py", line 47, in run_cmd explicit=cli_args.explicit or not sys.stdout.isatty() File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/reporting/console.py", line 230, in print_report _print_chunks(chunks) File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/reporting/console.py", line 196, in _print_chunks for chunk in chunks: File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/reporting/console.py", line 189, in render_results yield self.render_test(result) File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/reporting/console.py", line 166, in render_test return self.render_chunk(test.description, short_description, test.status, test.steps) File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/reporting/console.py", line 142, in render_chunk details = self.render_steps(steps) File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/reporting/console.py", line 110, in render_steps self.render_highlighted(self.wrap_description_col(entry.message)) File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/reporting/console.py", line 72, in wrap_description_col return wrap_text(description, int((self.max_width - self._table_overhead) * 0.75)) File "/var/lib/jenkins/workspace/qa/venv/local/lib/python2.7/site-packages/lemoncheesecake/helpers/text.py", line 21, in wrap_text textwrap.wrap(line, width) for line in text.split("\n") AttributeError: 'bool' object has no attribute 'split'

@ndelon
Copy link
Contributor

ndelon commented Sep 10, 2019

Ok, then it seems to be with a log_{debug,warning,info,error} call where instead of passing a string, you pass a boolean.

Regards.

@shivamgarg17
Copy link
Author

shivamgarg17 commented Sep 10, 2019 via email

@ndelon
Copy link
Contributor

ndelon commented Sep 10, 2019

If you're talking about a previous version of lemoncheesecake, this behavior has not changed since 0.22.0.

I encourage you to check your calls to lcc.log_*, since the issue appear in a failed test, this limit your search. You can also look for True and False occurrences in logs in the resulting report/report.js file.

@shivamgarg17
Copy link
Author

shivamgarg17 commented Sep 11, 2019 via email

@ndelon
Copy link
Contributor

ndelon commented Sep 16, 2019

In the new lemoncheesecake 1.2.2 release (https://github.com/lemoncheesecake/lemoncheesecake/blob/master/CHANGELOG.md#122-2019-09-15), data going persisted into the report are now strictly type-checked ASAP and will avoid more complicated debugging sessions.
For instance, something such as lcc.log_info(True) will now raise a TypeError exception.

@shivamgarg17
Copy link
Author

If you're talking about a previous version of lemoncheesecake, this behavior has not changed since 0.22.0.

I encourage you to check your calls to lcc.log_*, since the issue appear in a failed test, this limit your search. You can also look for True and False occurrences in logs in the resulting report/report.js file.

Hi @ndelon ,
Its worked after converting them into string
Thanks

@ndelon ndelon closed this as completed Sep 17, 2019
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

No branches or pull requests

2 participants