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

fix: Make django-app unit tests work; test this in cookiecutter CI #216

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

timmc-edx
Copy link
Contributor

@timmc-edx timmc-edx commented Jul 11, 2022

  • Add placeholder test to allow pytest to run without complaining about
    not finding any tests (exit code 5).
  • Trim tox default envs to just pytest ones; add doc env explicitly to
    test-all Makefile target to compensate.

This just fixes cookiecutter-django-app for now; other cookiecutters can
be fixed once this is shown to work.

Merge checklist:

  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

@timmc-edx timmc-edx force-pushed the timmc/tests branch 4 times, most recently from 784b493 to 68444ec Compare July 11, 2022 23:57
@timmc-edx timmc-edx changed the title fix: Add placeholder test to allow cookiecutter tests to pass immediately fix: Make django-app unit tests work; test this in cookiecutter CI Jul 11, 2022
- Add placeholder test to allow pytest to run without complaining about
  not finding any tests (exit code 5).
- Trim tox default envs to just pytest ones; add `doc` env explicitly to
  `test-all` Makefile target to compensate.

This just fixes cookiecutter-django-app for now; other cookiecutters can
be fixed once this is shown to work.
def test_tests(options_baked):
"""Make sure the tox default tests work"""
try:
run_in_virtualenv('pip install -r requirements/ci.txt; tox')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tries to match the GitHub check as closely as possible -- which is part of why I rearranged the tox default envlist so we can just run tox to get the pytest runs. (Our repos seem split on which approach they take for envlist.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a small ADR on approaches and why we are taking one over the other?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: Where do the GitHub checks come from? Are they in the cookiecutter, or does someone need to know what to set up? Are these documented?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it's worth doing. Maybe if we decide to apply this to all the templates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checks come in via the templates -- either the base one or additional ones in the layered templates. Example: https://github.com/openedx/edx-cookiecutters/blob/master/python-template/%7B%7Bcookiecutter.placeholder_repo_name%7D%7D/.github/workflows/ci.yml#L37

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for the link.

@timmc-edx timmc-edx merged commit 7c0722a into master Jul 12, 2022
@timmc-edx timmc-edx deleted the timmc/tests branch July 12, 2022 21:20
timmc-edx added a commit to openedx/event-bus-kafka that referenced this pull request Jul 13, 2022
timmc-edx added a commit to openedx/event-bus-kafka that referenced this pull request Jul 18, 2022
Implement `send_to_event_bus`, accepting signal, data, topic, and key information.

- Addresses #5
- Core talk-to-Kafka parts were copied from license manager prototype work, including
  https://github.com/openedx/license-manager/blob/38b38b0979bb5f643595337a9c189f619a7d483b/license_manager/apps/subscriptions/event_bus_utils.py#L56
- Manually tested against devstack Kafka (instructions included in commit)
- Punting on caching the producer for now, but do at least cache the serializer

Also:

- Remove deprecated config line
- Include some recent improvements from cookiecutter:
    - openedx/edx-cookiecutters#199 (requirements)
    - openedx/edx-cookiecutters#216 (test-all)

Small improvements that should be upstreamed to the cookiecutter:

- Clean up after docs build and before test-all
- Ignore pii_report output dir
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