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 tests #4206

Merged
merged 4 commits into from
Jun 4, 2024
Merged

Fix tests #4206

merged 4 commits into from
Jun 4, 2024

Conversation

ajrbyers
Copy link
Member

@ajrbyers ajrbyers commented May 30, 2024

Fixes various borked tests.

@ajrbyers ajrbyers changed the title Tweak expected outputs for preprit OAI. Fix tests May 30, 2024
@mauromsl mauromsl self-requested a review May 31, 2024 08:45
@mauromsl mauromsl requested a review from StephDriver May 31, 2024 10:47
@joemull joemull requested review from joemull and removed request for StephDriver May 31, 2024 13:16
@joemull joemull assigned joemull and unassigned StephDriver May 31, 2024
Copy link
Member

@joemull joemull left a comment

Choose a reason for hiding this comment

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

Thanks for fixing these! I ran them and I think there is still some test data interference.

Here's what I get when I run all the tests:

$ python src/manage.py test

FAIL: test_list_sets (src.api.tests.test_oai.TestOAIViews)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/joemull/git/janeway/venv/lib/python3.10/site-packages/django/test/utils.py", line 387, in inner
    return func(*args, **kwargs)
  File "/home/joemull/git/janeway/venv/lib/python3.10/site-packages/freezegun/api.py", line 789, in wrapper
    result = func(*args, **kwargs)
  File "/home/joemull/git/janeway/src/api/tests/test_oai.py", line 216, in test_list_sets
    self.assertEqual(result.split(), expected.split())
AssertionError: Lists differ: ['<?x[874 chars]tion:3</setSpec>', '<setName>Article</setName>[36 chars]MH>'] != ['<?x[874 chars]tion:1</setSpec>', '<setName>Article</setName>[36 chars]MH>']

First differing element 47:
'<setSpec>TST:section:3</setSpec>'
'<setSpec>TST:section:1</setSpec>'

But if I just run this test, it passes:

$ python src/manage.py test api.tests.test_oai.TestOAIViews.test_list_sets
Creating test database for alias 'default'...
System check identified no issues (17 silenced).
.
----------------------------------------------------------------------
Ran 1 test in 2.014s

OK

@ajrbyers ajrbyers requested a review from joemull June 4, 2024 09:08
@ajrbyers ajrbyers assigned joemull and unassigned ajrbyers Jun 4, 2024
@ajrbyers
Copy link
Member Author

ajrbyers commented Jun 4, 2024

Dear Mr Jenkins: test this please

Copy link
Member

@joemull joemull left a comment

Choose a reason for hiding this comment

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

Super -- all tests are now passing locally for me using the standard test runner 💯

@joemull joemull merged commit 73c0fbe into master Jun 4, 2024
1 check passed
@joemull joemull deleted the fix_oai_tests branch June 4, 2024 14:58
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.

4 participants