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

test_smartmatch fails to run on windows #1124

Open
bmos opened this issue Sep 6, 2024 · 0 comments
Open

test_smartmatch fails to run on windows #1124

bmos opened this issue Sep 6, 2024 · 0 comments
Labels
bug Impact - something is currently broken in Parsons and needs to be fixed high priority Priority - addressing this is an urgent need for a broad swath of Parsons users testing Work type - writing or changing code tests for core Parsons features or Parsons connectors

Comments

@bmos
Copy link
Contributor

bmos commented Sep 6, 2024

When tests are run on Windows, test_smartmatch is skipped (a decision we made so we could add windows tests sooner).

The commit that skips them (revert once the test passes): b00f608

The error when you run the test:

================================== FAILURES ===================================
_______________________________ test_smartmatch _______________________________

intable = +------------+-----------+------------+-------------------+--------------+--------------------+
| first_name | last_na...| ''                 |
+------------+-----------+------------+-------------------+--------------+--------------------+

submit_filename = 'parsons_test.csv'
raw_outgz = b"\x1f\x8b\x08\x00\x00\x13\xdaf\x02\xffmMK\xaa\x021\x10\xdc\x0b\xde\xe1\x1d\xa0\x14F=\x80\n\xc2\xdb\x88\x0bW\xaeB'\xd3...\xb0\xfb\x9f<\xd8x4C\xc5*x\xc7\xd8\xbc\x0c\x9f\x14\xc0R\xfa\x12\xcfQ\xb1\xa7\x10n\xbf\xc4_\xca;M\x0b=&\x1c\x01\x00\x00"
raw_outcsv = 'matchback_id,ts__row,ts__input_row,first_name,last_name,address1,email,phone,some_unknown_field,tsmart_match_code,vb....1231231234,foo,Y,OH-123\r\n2,2,2,Alice,Example,123 Main,,,bar,Y,OH-123\r\n3,3,3,Sally,Example,123 Main,,,,Y,OH-123\r\n'
raw_outtable = +--------------+---------+---------------+------------+-----------+------------+-------------------+--------------+---...----------+------------+-------------------+--------------+--------------------+-------------------+-----------------+

final_outtable = +------------+-----------+------------+-------------------+--------------+--------------------+---------+-------------...----------+------------+-------------------+--------------+--------------------+-------------------+-----------------+

requests_mock = <requests_mock.mocker.Mocker object at 0x0000022F8C4CF4C0>

    def test_smartmatch(
        intable,
        submit_filename,
        raw_outgz,
        raw_outcsv,
        raw_outtable,
        final_outtable,
        requests_mock,
    ):
        ts = TargetSmartAPI("mockkey")
        resp1 = {"url": "https://mock_smartmatch_upload_endpoint", "error": None}
        poll_resp = {"url": "https://mock_smartmatch_download_endpoint", "error": None}
        requests_mock.get("https://api.targetsmart.com/service/smartmatch", json=resp1)
        requests_mock.put(resp1["url"])
        requests_mock.get("https://api.targetsmart.com/service/smartmatch/poll", json=poll_resp)
        requests_mock.get(poll_resp["url"], content=raw_outgz)
    
>       results = ts.smartmatch(intable).to_petl()

test\test_targetsmart\test_targetsmart_smartmatch.py:90: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
parsons\targetsmart\targetsmart_smartmatch.py:255: in smartmatch
    dataprep_table.tocsv(tmp.name, encoding="utf8")
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\petl\io\csv.py:108: in tocsv
    tocsv_impl(table, source=source, encoding=encoding, errors=errors,
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\petl\io\csv_py3.py:44: in tocsv_impl
    _writecsv(table, source=source, mode='wb', **kwargs)
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\petl\io\csv_py3.py:53: in _writecsv
    with source.open(mode) as buf:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <petl.io.sources.FileSource object at 0x0000022F9060A440>, mode = 'wb'

    def open(self, mode='r'):
>       return io.open(self.filename, mode, **self.kwargs)
E       PermissionError: [Errno 13] Permission denied: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmprnpqah32\\smartmatch_inputv4dzcdf7.csv'

C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\petl\io\sources.py:33: PermissionError
============================== warnings summary ===============================
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\paramiko\pkey.py:100
  C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\paramiko\pkey.py:100: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
    "cipher": algorithms.TripleDES,

C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\paramiko\transport.py:259
  C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\paramiko\transport.py:259: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
    "class": algorithms.TripleDES,

C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\joblib\my_exceptions.py:21
  C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\joblib\my_exceptions.py:21: DeprecationWarning: TransportableException is deprecated and will be removed from joblib in 0.16
    warn("{} is deprecated and will be removed from joblib "

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ===========================
FAILED test/test_targetsmart/test_targetsmart_smartmatch.py::test_smartmatch - PermissionError: [Errno 13] Permission denied: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmprnpqah32\\smartmatch_inputv4dzcdf7.csv'
===== 1 failed, 842 passed, 191 skipped, 1 xfailed, 3 warnings in 29.63s ======
@bmos bmos added the bug Impact - something is currently broken in Parsons and needs to be fixed label Sep 6, 2024
@shaunagm shaunagm added high priority Priority - addressing this is an urgent need for a broad swath of Parsons users connector update Work type - additions or changes to the functions of an existing Parsons connector testing Work type - writing or changing code tests for core Parsons features or Parsons connectors and removed connector update Work type - additions or changes to the functions of an existing Parsons connector labels Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Impact - something is currently broken in Parsons and needs to be fixed high priority Priority - addressing this is an urgent need for a broad swath of Parsons users testing Work type - writing or changing code tests for core Parsons features or Parsons connectors
Projects
None yet
Development

No branches or pull requests

2 participants