cve-bin-tool icon indicating copy to clipboard operation
cve-bin-tool copied to clipboard

feat: basic tests for no-scan mode

Open joydeep049 opened this issue 7 months ago • 5 comments

Related Discussion : #5136

cc @terriko @anthonyharrison @mastersans

joydeep049 avatar Jun 11 '25 11:06 joydeep049

Re-running the tests with an empty commit because: 12 06 2025_22 35 43_REC

joydeep049 avatar Jun 12 '25 17:06 joydeep049

Looks like this might be the underlying issue that caused the failure:

test/test_no_scan.py::test_normal_scan
  C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\_pytest\threadexception.py:58: PytestUnhandledThreadExceptionWarning: Exception in thread Thread-5 (_readerthread)
  
  Traceback (most recent call last):
    File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\threading.py", line 1075, in _bootstrap_inner
      self.run()
    File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\threading.py", line 1012, in run
      self._target(*self._args, **self._kwargs)
    File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\subprocess.py", line 1599, in _readerthread
      buffer.append(fh.read())
                    ^^^^^^^^^
    File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\encodings\cp1252.py", line 23, in decode
      return codecs.charmap_decode(input,self.errors,decoding_table)[0]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 21620: character maps to <undefined>

Possibly a text encoding problem on Windows?

stvml avatar Jun 13 '25 15:06 stvml

BTW, the linters should be back up if you need them, but the rest of the tests are still failing due to the cache.

terriko avatar Jun 25 '25 21:06 terriko

I'm going to update hte branch to see where we're at now.

terriko avatar Aug 20 '25 19:08 terriko

=================================== FAILURES ===================================
________________ TestOutputHTML.test_modal_switching[chromium] _________________
[gw0] linux -- Python 3.13.7 /opt/hostedtoolcache/Python/3.13.7/x64/bin/python

self = <test.test_html.TestOutputHTML object at 0x7fe4dbc32710>

    def test_modal_switching(self) -> None:
        """Test modal to be visible when clicked on the product row or the vendor_product pill
        and to be hidden when clicked on the close button"""
    
        modal_content = self.html_report_page.modal_content.nth(0)
        product_row = self.html_report_page.product_rows.nth(0)
        modal_close_button = self.html_report_page.modal_close_button.nth(0)
        vendor_product_pill = self.html_report_page.vendor_product_pill.nth(0)
    
        expect(modal_content).to_be_hidden()
        product_row.click()
        expect(modal_content).to_be_visible()
        modal_close_button.click()
>       expect(modal_content).to_be_hidden(timeout=10000)
E       AssertionError: Locator expected to be hidden
E       Actual value: visible 
E       Call log:
E         - Expect "to_be_hidden" with timeout 10000ms
E         - waiting for locator(".modal-content").first
E           14 × locator resolved to <div class="modal-content">…</div>
E              - unexpected value "visible"

test/test_html.py:206: AssertionError

I do not understand what's going on here. @terriko @anthonyharrison

joydeep049 avatar Aug 21 '25 07:08 joydeep049