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

Make reporting/logging for Python integration test infrastructure a bit more sane #113

Open
absurdfarce opened this issue Mar 18, 2021 · 4 comments · May be fixed by #159
Open

Make reporting/logging for Python integration test infrastructure a bit more sane #113

absurdfarce opened this issue Mar 18, 2021 · 4 comments · May be fixed by #159
Assignees
Labels
enhancement New feature or request medium

Comments

@absurdfarce
Copy link
Collaborator

absurdfarce commented Mar 18, 2021

Feature Request

Description

#104 introduced a new framework for integration tests implemented entirely in Python. In the rush to get this done some shortcuts were taken around reporting and logging that should be remedied when we have a bit more time. These shortcuts include:

  • Location of the log file
    • The framework makes vigorous use of Python's facilities for logging, but this leads to some inconsistency between Python versions. Python2 creates the log file "adelphi.log" in what appears to be the current working directory while Python3 winds up creating it in the temp directory we create while running the tests. This introduces at least two distinct problems:
      • You have to remember which Python version you're using to remember where to look
      • Temp directories are deleted by default after the tests complete so unless you pass the KEEP_LOGS env var you're out of luck
  • Reporting of differences between reference schemas and generated schemas
    • Comparison of CQL statements is done by comparing sha256 hashes of the statements but some effort was put in to preserving the raw text statements themselves for logging purposes
    • Unfortunately these statements are only available in the log
    • The test as currently implemented does an unittest.assertEqual() on two sets of sha256 digests... which means when differences exist they fail the test but only report the digests
    • Users must then correlate these digests to statements by looking in adelphi.log
    • This should be amended to directly report CQL statements when assertions fail
  • _compareToReference assumes it's dealing with CQL files [ADDRESSED IN Export to output directory not properly constrained by keyspace #106]
    • This is wrong in the abstract
    • Also wrong in practice since it won't work with the nosqlbench test
  • test_diff is poorly named [ADDRESSED IN Export to output directory not properly constrained by keyspace #106]
    • It made sense originally but we have other diff tests now
    • The test should be renamed to identify what's unique about it now, specifically that it deal with CQL statements

┆Issue is synchronized with this Jira Task by Unito
┆Issue Number: AD-35

@absurdfarce absurdfarce added the enhancement New feature or request label Mar 18, 2021
absurdfarce added a commit that referenced this issue Mar 19, 2021
around _compareToReference only dealing with CQL files.  The change in this PR moves CQL-specific logic
into the CQL-relevant test test_diff.py and implements similar functionality for YAML in test_nb.py.
@absurdfarce
Copy link
Collaborator Author

Note that the PR for #106 addresses the CQL-specific _compareToReference stuff mentioned above.

@absurdfarce
Copy link
Collaborator Author

The bit about test_diff and it's naming is also likely to get addressed as part of the PR for #106

@jdonenine jdonenine modified the milestones: Performance Testing Pathways, Automated Performance Testing Integration Apr 12, 2021
@jdonenine jdonenine removed this from the Automated Performance Testing Integration milestone Jun 7, 2021
@absurdfarce
Copy link
Collaborator Author

Yup, #106 did wind up addressing the test_diff naming question.

@absurdfarce
Copy link
Collaborator Author

The log bits of this ticket are addressed via the use of tox and it's log capture facilities. Pretty sure all that's left here is a better hash comparison of CQL files... and even that at least consistently shows up in the tox output IIRC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium
Projects
None yet
2 participants