Skip to content

Rework tests #449

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

Closed
adorton-adobe opened this issue Feb 8, 2019 · 1 comment · Fixed by #448
Closed

Rework tests #449

adorton-adobe opened this issue Feb 8, 2019 · 1 comment · Fixed by #448
Assignees

Comments

@adorton-adobe
Copy link
Collaborator

We're overhauling the User Sync Tool's testing infrastructure.

Rationale:

  • pytest is preferable to nose - much simpler to use and powerful, flexible fixture system
  • Testing framework for black box tests is confusing, difficult to use and doesn't integrate with CI systems
  • 99% of what we can do in the black-box framework can be done as unit tests (by targeting app.main(), the entrypoint used by the pex build)

Changes in this update:

  • Remove old tests/ directory (if needed, can get old tests in v2.4)
  • Remove test_framework/ (any components we might need can be obtained in v2.4)
  • Define a few new tests in tests/ directory
  • Update setup and test dependencies in setup.py
  • Configure to run pytest with python setup.py test
  • Enable coverage reporting
  • Fixture files for base config files
  • Define fixtures to get base fixture directory and to get & modify base config files
  • Refactor LDAP connector to isolate configuration option handling so we can test it
  • Modify CI config and scripts to run tests

Rough roadmap:

  • Define fixtures to mock UMAPI (we'll probably want to use the vcr.py-based mock server from the old test_framework)
  • Define fixtures to mock LDAP (once we switch to ldap3 as per Switch to ldap3 #436, we can use its mock LDAP server)
  • Create a few tests that run the pex file to make sure the build succeeds. We'll need to integrate this with the CI builds and make these tests optional to run locally
@adorton-adobe
Copy link
Collaborator Author

We may not need the mock UMAPI server, there's an plugin that integrates vcr.py and pytest:

https://pytest-vcr.readthedocs.io/en/latest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant