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

A unit Test to make sure ClockedSchedule and PeriodicTasks are shown in TimeZone format #485

Merged
merged 7 commits into from
Apr 11, 2022

Conversation

moreaba
Copy link
Contributor

@moreaba moreaba commented Dec 17, 2021

This is a unit test for merged pull request #464

@moreaba
Copy link
Contributor Author

moreaba commented Dec 17, 2021

@auvipy Here is the unit test

t/unit/test_models.py Outdated Show resolved Hide resolved
"""Make sure the scheduled time is not shown in UTC when time zone is used"""
tz_info = pytz.timezone(settings.TIME_ZONE).localize(datetime.datetime.utcnow())
schedule, created = ClockedSchedule.objects.get_or_create(clocked_time=tz_info)
self.assertEquals(str(schedule.clocked_time), str(schedule)) # testnig str(schedule) calls make_aware() internally
Copy link
Member

Choose a reason for hiding this comment

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

also assert should be in pytest style for any celery project

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@auvipy
when I run pytest I get 97 errors, although when I run pytest --fixtures it says collected 97 items.
any cluses?

Copy link
Contributor Author

@moreaba moreaba Dec 18, 2021

Choose a reason for hiding this comment

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

I get:

fixture 'patching' not found
file \django-celery-beat\t\unit\conftest.py, line 29

@pytest.fixture(autouse=True)
def test_cases_shortcuts(request, app, patching):

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 have updated the assert and pushed a commit.
Please let me know if you need anything.
Also, please let me know how to pytest it without errors.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

use any linter for the style issues

t/unit/test_models.py Outdated Show resolved Hide resolved
t/unit/test_models.py Outdated Show resolved Hide resolved
.vscode/settings.json Outdated Show resolved Hide resolved
t/unit/test_models.py Outdated Show resolved Hide resolved
@moreaba moreaba force-pushed the master branch 2 times, most recently from a7ab941 to ff72ba9 Compare December 19, 2021 16:33
@auvipy
Copy link
Member

auvipy commented Dec 20, 2021

were you able to run test locally?

@moreaba
Copy link
Contributor Author

moreaba commented Dec 21, 2021

@auvipy Yes I ran the test successfully, but this was only using 'python manage.py test'
pytest did not work with me although I have installed the requirements.
It fails at
\django-celery-beat\t\unit\conftest.py, line 29

fixture 'patching' not found

if you can help please let me know.
Thanks

@auvipy auvipy added this to the v2.3.0 milestone Jan 3, 2022
@auvipy
Copy link
Member

auvipy commented Jan 4, 2022

please wait untill i make the CI work. i might need to push to your branch as well

@moreaba
Copy link
Contributor Author

moreaba commented Feb 28, 2022

please wait untill i make the CI work. i might need to push to your branch as well

Hi @auvipy
Any updates? should we merge this unit test?

@auvipy auvipy closed this Apr 11, 2022
@auvipy auvipy reopened this Apr 11, 2022
@auvipy
Copy link
Member

auvipy commented Apr 11, 2022

I have started CI to test this properly

@auvipy auvipy merged commit 94ed46a into celery:master Apr 11, 2022
@niiiitz
Copy link

niiiitz commented Jun 13, 2022

v 2.3.0 of beat segfaults in our cloudfoundry env, with an error that suggests that this unit test is failing.

11:07:42.847: [APP/PROC/WEB.0] ERROR 2022-06-10 15:07:42,845 none 53 --- 280 [celery.utils.dispatch.signal] send : Signal handler <bound method DjangoFixup.on_import_modules of <celery.fixups.django.DjangoFixup object at 0x7f60c1d25ac0>> raised: ValueError("Extraneous characters at end of TZ string: b'<+12>-12<+13>,M11.1.0,M1.2.2/123'")

@auvipy
Copy link
Member

auvipy commented Jun 14, 2022

v 2.3.0 of beat segfaults in our cloudfoundry env, with an error that suggests that this unit test is failing.

11:07:42.847: [APP/PROC/WEB.0] ERROR 2022-06-10 15:07:42,845 none 53 --- 280 [celery.utils.dispatch.signal] send : Signal handler <bound method DjangoFixup.on_import_modules of <celery.fixups.django.DjangoFixup object at 0x7f60c1d25ac0>> raised: ValueError("Extraneous characters at end of TZ string: b'<+12>-12<+13>,M11.1.0,M1.2.2/123'")

can you work on a fix?

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.

3 participants