-
Notifications
You must be signed in to change notification settings - Fork 27
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 test case logs URL #207
base: main
Are you sure you want to change the base?
Conversation
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.
Please fix the issues reported by Travis CI.
Also this caused an exception in the backend on staging:
Jan 28 21:41:05 kernelci-staging kernelci-celery[65490]: File "/srv/api.staging.kernelci.org/app/utils/lava_log_parser.py", line 151, in run
Jan 28 21:41:05 kernelci-staging kernelci-celery[65490]: log_buffer.append(sl + timestamp + fmt.format(cgi.escape(msg)) + el)
Jan 28 21:41:05 kernelci-staging kernelci-celery[65490]: AttributeError: 'NoneType' object has no attribute 'format'
ffdbb57
to
fe59bf3
Compare
Hello @gctucker, I fixed what you told me about, but there is something else must be fixed I guess that I am not able to determine from the CI build, do you have an idea about what fails ? |
@touilkhouloud You need to find the detailed log from the Travis CI job to see the errors: These are simple unit test failures, because you're adding a new field to the test case document. You can reproduce the failures locally this way:
I think you should just need to add some values with your new field there to make it pass. |
2061abe
to
ec6b5f7
Compare
@gctucker Hello, is everything fine or I need to change something else ? |
Thanks for fixing the issues, I'm starting another round of tests on staging to verify it. |
I tried this in a fresh, local instance of kernelci-docker[0] (using staging branch of both frontend and backend). I then ran a baseline test via LAVA[1] which submitted results via the callback. Looking in the database, I see that Is there a LAVA patch needed to send the log lines in the callback data? [0] http://khilman.ddns.net:8080/ |
Hello, I had a look on your json file and the problem is there I don't know why the |
@touilkhouloud I had a look at a LAVA callback JSON provided by @khilman and it looks that it lacks line numbers in the "lava" test cases which is completely normal, but in the "real" test case
I guess that the reason of those not being stored is different. I went through the code of this PR and it seems to me that it extends the test_case document model with a field to store the line number, but it doesn't provide necessary LAVA callback handling to put there the actual value. My proposal is to merge this PR as it extends the model and adds links in the HTML log, then rebase the #214 on top of it and merge. I mentioned it already in the comment under #214. @khilman @gctucker What do you think of that? |
I think we should have a first PR that just adds IDs to the HTML log file so we can have anchored links to them. That way we can get this part merged quicker. It would also mean having the correct line numbers that work for the log povided by KernelCI as opposed to the one provided by LAVA which has extra LAVA-specific debugging information. Then as a follow-up PR we can have the new field in the test case document and the LAVA callback logic to populate it. |
@touilkhouloud Could you please make a PR with just the first patch |
ec6b5f7
to
0ddff45
Compare
0ddff45
to
3534863
Compare
e8e1435
to
fd1ac36
Compare
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.
fd1ac36
to
8306ddb
Compare
In the test email report, each failing test will have a link to its logs in the html log file which is stored in the KernelCI data base. For that, we need to store the log line from the LAVA callback, adding this data to the data base and using it to generate the log url for each failing test case. Signed-off-by: Khouloud Touil <ktouil@baylibre.com>
8306ddb
to
adb6b85
Compare
Hello, @gctucker please can you have a look on this PR ? |
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.
A few more things to week, #214 should be merged today or tomorrow so it can be used as a basis now.
@@ -175,6 +175,7 @@ | |||
SYSTEM_MAP_SIZE_KEY = "system_map_size" | |||
TEST_CASE_ID_KEY = "test_case_id" | |||
TEST_CASE_PATH_KEY = "test_case_path" | |||
TEST_CASE_LOG_LINE_KEY = "test_case_log_line" |
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.
Please rename to LOG_LINE_NUMBER_KEY
, as log lines are actual lines from the log. The new field you're adding is intended to be a line number. Also I don't think we need to call it TEST_CASE_LOG_LINE_NUMBER_KEY
since this could be used in theory in other places where a log line number is needed.
@@ -57,6 +57,7 @@ def __init__(self, name, version="1.0"): | |||
self._measurements = [] | |||
self._status = None | |||
self._test_group_id = None | |||
self._test_case_log_line = None |
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.
Similarly, please change to self._log_line_number
.
@@ -480,6 +480,9 @@ def _add_test_results(group, results): | |||
reference = test_meta.get("reference") | |||
if reference: | |||
test_case[models.ATTACHMENTS_KEY] = [reference] | |||
test_case_log_line = test.get("log_start_line") |
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.
Please rebase on top of #214 as it works out the line numbers. In spite of its name, log_start_line
is not actually the line number where the test case started.
@@ -60,6 +60,9 @@ Test Failures | |||
{%- for tc in group.test_cases %} | |||
{%- if 'FAIL' == tc.status %} | |||
* {{ tc.name }}: | |||
{%- if tc.test_case_log_line %} | |||
Test case HTML log: {{ storage_url }}/{{ group.file_server_resource }}/{{ group.lab_name }}/{{ group.boot_log_html }}#L{{ tc.test_case_log_line }} |
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.
I believe the line number stored from the LAVA meta-data is not going to match what is in the HTML log, because some lines are removed (LAVA debug...). For similar reasons, the line numbers will be different in the HTML and plain text log files. So I think we need to be more specific and maybe call this field html_log_line_number
, and translate the line numbers when creating the HTML log file.
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.
in the #216 when added the line number in the html file, I am doing in the way to add the number as close as possible to the lava callback log, if you didn't understand what I mean, see this link view-source:https://storage.staging.kernelci.org//kernelci/staging.kernelci.org/staging-20200421.0/arm/multi_v7_defconfig/gcc-8/lab-collabora/sleep-imx6q-sabrelite.html
you find for example line 8(L8) then 10(L10) but not line 9(L9).
Even if it's not the exact start line but in the exact logs, so I guess it's enough no ?
@gctucker @khilman
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.
Well I think it's a bug that some log line numbers are missing in the output HTML log to start with. The numbers should be based in the HTML log, not where they came from.
Then the log line numbers stored in the test case should match exactly the line numbers in the HTML log.
All this data is known and handled by the backend code so it should only be a matter of fixing the logic.
No description provided.