#50839 Issue 50627 - Add ASAN logs to HTML report
Closed 3 years ago by spichugi. Opened 4 years ago by vashirov.
vashirov/389-ds-base ds50627  into  master

file modified
+15 -8
@@ -78,14 +78,21 @@ 

  

  @pytest.fixture(scope="function", autouse=True)

  def rotate_xsan_logs(request):

-     if p.asan_enabled:

-         xsan_logs_dir = f'{p.run_dir}/bak'

-         if not os.path.exists(xsan_logs_dir):

-             os.mkdir(xsan_logs_dir)

-         else:

-             for f in glob.glob(f'{p.run_dir}/ns-slapd-*san*'):

-                 shutil.move(f, xsan_logs_dir)

-         return rotate_xsan_logs

+     # Do we have a pytest-html installed?

+     pytest_html = request.config.pluginmanager.getplugin('html')

+     if pytest_html is not None:

+         # We have it installed, but let's check if we actually use it (--html=report.html)

+         pytest_htmlpath = request.config.getoption('htmlpath')

+         if p.asan_enabled and pytest_htmlpath is not None:

+             # ASAN is enabled and an HTML report was requested,

+             # rotate the ASAN logs so that only relevant logs are attached to the case in the report.

+             xsan_logs_dir = f'{p.run_dir}/bak'

+             if not os.path.exists(xsan_logs_dir):

+                 os.mkdir(xsan_logs_dir)

+             else:

+                 for f in glob.glob(f'{p.run_dir}/ns-slapd-*san*'):

+                     shutil.move(f, xsan_logs_dir)

+             return rotate_xsan_logs

  

  

  @pytest.hookimpl(hookwrapper=True)

Bug Description:
ASAN log files were rotated even when HTML report was not used.

Fix Description:
Rotate the ASAN log files only when a path to the HTML report is provided.

Relates: https://pagure.io/389-ds-base/issue/50627

rebased onto 76571de

4 years ago

Pull-Request has been merged by vashirov

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3893

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata