Closed Bug 1417530 Opened 7 years ago Closed 3 years ago

[tracker] Shift existing Pontoon tests to py.test

Categories

(Webtools Graveyard :: Pontoon, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED MOVED

People

(Reporter: ryan, Assigned: jotes)

References

Details

Attachments

(7 files)

After discussing adopting py.test for testing Pontoon, we agreed to translate some of the existing tests to py.test.

This will allow us to see how the tests can be refactored, and the resources required to do so.

Personally, it will allow me to go through the existing tests 8)

There is also a question of how to format the layout for tests, ref: https://github.com/mozilla/pontoon/pull/758#issuecomment-344592174
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/70c067a248eae58594e57cadcb76ff396253e579
Touch bug 1417530 Add fixtures (#763)

- Add site env to test fixtures
- Add base fixtures
- Add simple tests for test env
- Add docstrings to fixtures
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/969c923c1978ca816edf5137f94b65c1f6e5d63f
Touch bug #1417530 Add more fixtures (#770)

- Add site_matrix fixture
- Add translated resources fixtures
- Add factories fixture
- Add model factories
- Add simple tests for fixtures
- Update test env
  - include translated resources
  - set correct total_strings on resources
Priority: -- → P3
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/8edca99f7fa39e5a26132075824cae614ce356fc
Touch bug 1417530 Shift base model tests to pytest (#762)

- Add fixtures for base model tests
- Shift base model tests - Project
- Shift base model tests - Repository
- Shift base model tests - Locale
- Shift base model tests - Translation
- Shift base model tests - ProjectLocale
- Shift base model tests - Entity
- Shift base manager tests - User
- Shift base manager tests - Entity
- Remove old base model tests
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/3749ee7612a2467164485bacd2b1a000632021e6
Bug 1417530 - Install test requirements in docker. (#778)

* Bug 1417530 - Install test requirements in docker.

* Run tests with py.test during make dockertest.
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/17af08a74abe28cf383cee75473ce34541dc4ac6
Touch bug 1417530: Add more test fixtures

- Add further factories to site_matrix
- Add translated resourceX fixture
- Add translation to factories
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/60897c61a41dd4274180d9a5c0cb5987ab9ceb08
Touch bug 1417530: Shift base view tests #796

- Shift base view tests - Translation
- Shift base form tests - GetEntityForm
- Shift machinery view tests - TM
- Shift base view tests - Entity
- Shift base view tests - TMX
- Move tests data
- Remove old base view tests
- Move permission log form tests into forms directory
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/9aba759b5cabedd94e2b3eb547e65de26b874943
Touch bug 1417530 Shift remaining base tests to pytest #758

- Shift base command test - createsuperuser
- Shift base util tests
- Shift base adapter tests - Allauth
- Shift base helper tests
- Shift base signal test
- Shift base placeables tests
- Remove unused old test fixtures
- Remove old tests
Making this a tracker and taking. More bugs to follow!
Assignee: nobody → adrian
Summary: Shift existing Pontoon tests to py.test → [tracker] Shift existing Pontoon tests to py.test
Depends on: 1455246
What is the status of this bug? Do we also want to move to sync tests to pytest at some point?

Before closing it, let's at least fix test_view_entity_exclude_entities which is failing randomly, which is annoying.
Work is not done here. 

Here's a list of files / modules that still need to be migrated: 

- administration/tests
- api/tests
- base/tests/test_views.py
- contributors/tests.py
- db/tests/test_lookups.py
- localizations/tests.py
- sync/tests
- teams/tests.py

Anyone willing to migrate one, some or all of these, feel free!
Assignee: adrian → nobody
Assignee: nobody → poke
Status: NEW → ASSIGNED

Update - Here's a list of files / modules that still need to be migrated:

  • base/tests/test_views.py
  • contributors/tests.py
  • db/tests/test_lookups.py
  • sync/tests

Update - Here's a list of modules that still need to be migrated to pytest :

  • sync/tests
*This bug has been moved to GitHub.*

*Please check it out on https://github.com/mozilla/pontoon/issues.*
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → MOVED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: