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

Don't warn if kadi user can't access db #298

Merged
merged 1 commit into from
Apr 16, 2024
Merged

Don't warn if kadi user can't access db #298

merged 1 commit into from
Apr 16, 2024

Conversation

jeanconn
Copy link
Contributor

@jeanconn jeanconn commented Apr 1, 2024

Description

Don't warn if kadi user can't access db in testing.

We could also just catch the warning in ska_testr, but I think maybe it is most useful here to not emit it.

Without this, you get

mica/report/tests/test_write_report.py:25
  /proj/sot/ska/jeanproj/git/mica/mica/report/tests/test_write_report.py:25: UserWarning: On HEAD but Sqsh did not work. Unable to read inferred sqshrc file /proj/sot/ska/data/aspect_authorization/sqsh-sqlsao-axafvv-kadi
    warn(f"On HEAD but Sqsh did not work. {e}")

Interface impacts

Testing

Unit tests

  • Linux
ska3-jeanconn-kady> git rev-parse HEAD
061254c8e7696eb87b49f4388775a06ef9779a90
ska3-jeanconn-kady> pytest
============================================================================== test session starts ===============================================================================
platform linux -- Python 3.11.8, pytest-7.4.4, pluggy-1.4.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: anyio-4.3.0, timeout-2.2.0
collected 108 items                                                                                                                                                              

mica/archive/tests/test_aca_dark_cal.py ..................                                                                                                                 [ 16%]
mica/archive/tests/test_aca_hdr3.py .                                                                                                                                      [ 17%]
mica/archive/tests/test_aca_l0.py ...                                                                                                                                      [ 20%]
mica/archive/tests/test_asp_l1.py .......                                                                                                                                  [ 26%]
mica/archive/tests/test_cda.py ..............................................                                                                                              [ 69%]
mica/archive/tests/test_obspar.py .                                                                                                                                        [ 70%]
mica/report/tests/test_write_report.py .                                                                                                                                   [ 71%]
mica/starcheck/tests/test_catalog_fetches.py ...............                                                                                                               [ 85%]
mica/stats/tests/test_acq_stats.py ...                                                                                                                                     [ 87%]
mica/stats/tests/test_guide_stats.py ....                                                                                                                                  [ 91%]
mica/vv/tests/test_vv.py .........                                                                                                                                         [100%]

======================================================================== 108 passed in 378.49s (0:06:18

and as kadi user (warnings related to running out of a dir owned by jeanconn not the sqsh issue)

kadi-fido> pytest
=================================================================== test session starts ===================================================================
platform linux -- Python 3.11.8, pytest-7.4.4, pluggy-1.4.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: anyio-4.3.0, timeout-2.2.0
collected 108 items                                                                                                                                       

mica/archive/tests/test_aca_dark_cal.py ..................                                                                                          [ 16%]
mica/archive/tests/test_aca_hdr3.py .                                                                                                               [ 17%]
mica/archive/tests/test_aca_l0.py ...                                                                                                               [ 20%]
mica/archive/tests/test_asp_l1.py .......                                                                                                           [ 26%]
mica/archive/tests/test_cda.py ..............................................                                                                       [ 69%]
mica/archive/tests/test_obspar.py .                                                                                                                 [ 70%]
mica/report/tests/test_write_report.py s                                                                                                            [ 71%]
mica/starcheck/tests/test_catalog_fetches.py ...............                                                                                        [ 85%]
mica/stats/tests/test_acq_stats.py ...                                                                                                              [ 87%]
mica/stats/tests/test_guide_stats.py ....                                                                                                           [ 91%]
mica/vv/tests/test_vv.py .........                                                                                                                  [100%]

==================================================================== warnings summary =====================================================================
../../../../ska3/flight/lib/python3.11/site-packages/_pytest/cacheprovider.py:451
  /proj/sot/ska3/flight/lib/python3.11/site-packages/_pytest/cacheprovider.py:451: PytestCacheWarning: cache could not write path /proj/sot/ska/jeanproj/git/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/proj/sot/ska/jeanproj/git/.pytest_cache/v/cache/nodeids'
    config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../../../../ska3/flight/lib/python3.11/site-packages/_pytest/stepwise.py:56
  /proj/sot/ska3/flight/lib/python3.11/site-packages/_pytest/stepwise.py:56: PytestCacheWarning: cache could not write path /proj/sot/ska/jeanproj/git/.pytest_cache/v/cache/stepwise: [Errno 13] Permission denied: '/proj/sot/ska/jeanproj/git/.pytest_cache/v/cache/stepwise'
    session.config.cache.set(STEPWISE_CACHE_DIR, [])

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================= 107 passed, 1 skipped, 2 warnings in 447.99s (0:07:27

Independent check of unit tests by [REVIEWER NAME]

  • [PLATFORM]:

Functional tests

No functional testing.

@javierggt
Copy link
Contributor

I thought this should be fixed rather than ignored.

@jeanconn jeanconn requested a review from javierggt April 11, 2024 14:49
@jeanconn
Copy link
Contributor Author

@jeanconn
Copy link
Contributor Author

This is trivial but would clean up one testing hiccup.

@jeanconn jeanconn merged commit 24545ef into master Apr 16, 2024
@jeanconn jeanconn deleted the kadi-test branch April 16, 2024 15:53
This was referenced Apr 17, 2024
@javierggt javierggt mentioned this pull request May 1, 2024
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

Successfully merging this pull request may close these issues.

2 participants