Tests / confs/tests.py
TestConferenceOgImage::test_render_writes_file_and_updates_fields
First seen 13 hours ago in 0c23747
CI
github-actions:test
4 runs
Average
279 ms
median 226 ms
max 467 ms
max 467 ms
Phases
Setup 2 ms
Call 276 ms
Teardown 0.32 ms
Categories
App code 5 ms
Database 5 ms
Test code 1 ms
Factories 0.28 ms
Other (Libraries, pytest, Unsampled) 267 ms
8 database queries per run
Needs 34 MB of memory (max 34 MB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 7 hours ago ·
open run
call194 ms99.4%
CallInfo.from_call_pytest/runner.py:361194 ms99.4%
call_and_report.<locals>.<lambda>_pytest/runner.py:250194 ms99.4%
HookCaller.__call__pluggy/_hooks.py:512194 ms99.4%
PluginManager._hookexecpluggy/_manager.py:120194 ms99.4%
_multicallpluggy/_callers.py:121194 ms99.4%
pytest_runtest_call_pytest/runner.py:184194 ms99.4%
_django_setup_unittest.<locals>.non_debugging_runtestpytest_django/plugin.py:614194 ms99.4%
SimpleTestCase.__call__django/test/testcases.py:314194 ms99.4%
SimpleTestCase._setup_and_calldjango/test/testcases.py:369192 ms98.4%
TestCase.__call__<stdlib>/unittest/case.py:747192 ms98.4%
TestCase.run<stdlib>/unittest/case.py:691192 ms98.4%
TestCase._callTestMethod<stdlib>/unittest/case.py:637192 ms98.4%
TestConferenceOgImage.test_render_writes_file_and_updates_fieldsconfs/tests.py:1446 render_conference_og_image(conference)189 ms96.8%
render_conference_og_imageconfs/og_images.py:240 image = render_conference_og_image_to_image_obj(conference)145 ms74.5%
render_conference_og_image_to_image_objconfs/og_images.py:230 return image.resize(RESOLUTION, resample=Image.Resampling.LANCZOS)68 ms34.6%
Image.resizePIL/Image.py:243868 ms34.6%
render_conference_og_image_to_image_objconfs/og_images.py:18018 ms9.0%
_draw_centeredconfs/og_images.py:759 ms4.8%
draw_text_with_emojistarter_packs/splash_images.py:3178 ms4.3%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)7 ms3.7%
ImageDraw.textlengthPIL/ImageDraw.py:7087 ms3.7%
Text.get_lengthPIL/ImageText.py:3177 ms3.7%
FreeTypeFont.getlengthPIL/ImageFont.py:4037 ms3.7%
split_text_emoji_segmentsstarter_packs/splash_images.py:300 bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])1 ms0.5%
ImageDraw.textbboxPIL/ImageDraw.py:7361 ms0.5%
Text.get_bboxPIL/ImageText.py:4911 ms0.5%
Text._get_bboxPIL/ImageText.py:4551 ms0.5%
FreeTypeFont.getbboxPIL/ImageFont.py:4641 ms0.5%
draw_text_with_emojistarter_packs/splash_images.py:345 image_draw.text(1 ms0.5%
ImageDraw.textPIL/ImageDraw.py:6471 ms0.5%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:5911 ms0.5%
FreeTypeFont.getmask2PIL/ImageFont.py:6531 ms0.5%
_draw_centeredconfs/og_images.py:738 ms4.3%
_fit_font_sizeconfs/og_images.py:647 ms3.7%
_text_widthconfs/og_images.py:547 ms3.7%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)6 ms3.2%
ImageDraw.textlengthPIL/ImageDraw.py:7086 ms3.2%
Text.get_lengthPIL/ImageText.py:3176 ms3.2%
FreeTypeFont.getlengthPIL/ImageFont.py:4036 ms3.2%
split_text_emoji_segmentsstarter_packs/splash_images.py:300 bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])1 ms0.5%
ImageDraw.textbboxPIL/ImageDraw.py:7361 ms0.5%
Text.get_bboxPIL/ImageText.py:4911 ms0.5%
Text._get_bboxPIL/ImageText.py:4551 ms0.5%
FreeTypeFont.getbboxPIL/ImageFont.py:4641 ms0.5%
_fit_font_sizeconfs/og_images.py:631 ms0.5%
_load_fontsconfs/og_images.py:47 ImageFont.truetype(path, size) for path in glob.glob(str(settings.BASE_DIR / "static" / "NotoSans*.ttf"))1 ms0.5%
truetypePIL/ImageFont.py:8851 ms0.5%
truetype.<locals>.freetypePIL/ImageFont.py:8821 ms0.5%
FreeTypeFont.__init__PIL/ImageFont.py:2981 ms0.5%
render_conference_og_image_to_image_objconfs/og_images.py:169 _draw_centered(16 ms8.0%
_draw_centeredconfs/og_images.py:758 ms4.3%
draw_text_with_emojistarter_packs/splash_images.py:345 image_draw.text(6 ms3.2%
ImageDraw.textPIL/ImageDraw.py:6476 ms3.2%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:6364 ms2.1%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:5912 ms1.1%
FreeTypeFont.getmask2PIL/ImageFont.py:6532 ms1.1%
draw_text_with_emojistarter_packs/splash_images.py:3172 ms1.1%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)2 ms1.1%
ImageDraw.textlengthPIL/ImageDraw.py:7082 ms1.1%
Text.get_lengthPIL/ImageText.py:3172 ms1.1%
FreeTypeFont.getlengthPIL/ImageFont.py:4032 ms1.1%
_draw_centeredconfs/og_images.py:736 ms3.2%
_fit_font_sizeconfs/og_images.py:646 ms3.2%
_text_widthconfs/og_images.py:546 ms3.2%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)4 ms2.1%
ImageDraw.textlengthPIL/ImageDraw.py:7084 ms2.1%
Text.get_lengthPIL/ImageText.py:3174 ms2.1%
FreeTypeFont.getlengthPIL/ImageFont.py:4034 ms2.1%
split_text_emoji_segmentsstarter_packs/splash_images.py:300 bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])2 ms1.1%
ImageDraw.textbboxPIL/ImageDraw.py:7362 ms1.1%
Text.get_bboxPIL/ImageText.py:4912 ms1.1%
Text._get_bboxPIL/ImageText.py:4552 ms1.1%
FreeTypeFont.getbboxPIL/ImageFont.py:4642 ms1.1%
render_conference_og_image_to_image_objconfs/og_images.py:158 _draw_centered(14 ms6.9%
_draw_centeredconfs/og_images.py:736 ms3.2%
_fit_font_sizeconfs/og_images.py:645 ms2.7%
_text_widthconfs/og_images.py:545 ms2.7%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)3 ms1.6%
ImageDraw.textlengthPIL/ImageDraw.py:7083 ms1.6%
Text.get_lengthPIL/ImageText.py:3173 ms1.6%
FreeTypeFont.getlengthPIL/ImageFont.py:4033 ms1.6%
split_text_emoji_segmentsstarter_packs/splash_images.py:300 bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])2 ms1.1%
ImageDraw.textbboxPIL/ImageDraw.py:7362 ms1.1%
Text.get_bboxPIL/ImageText.py:4912 ms1.1%
Text._get_bboxPIL/ImageText.py:4552 ms1.1%
FreeTypeFont.getbboxPIL/ImageFont.py:4642 ms1.1%
_fit_font_sizeconfs/og_images.py:631 ms0.5%
_load_fontsconfs/og_images.py:47 ImageFont.truetype(path, size) for path in glob.glob(str(settings.BASE_DIR / "static" / "NotoSans*.ttf"))1 ms0.5%
truetypePIL/ImageFont.py:8851 ms0.5%
truetype.<locals>.freetypePIL/ImageFont.py:8821 ms0.5%
FreeTypeFont.__init__PIL/ImageFont.py:2981 ms0.5%
_draw_centeredconfs/og_images.py:756 ms3.2%
draw_text_with_emojistarter_packs/splash_images.py:3174 ms2.1%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)4 ms2.1%
ImageDraw.textlengthPIL/ImageDraw.py:7084 ms2.1%
Text.get_lengthPIL/ImageText.py:3174 ms2.1%
FreeTypeFont.getlengthPIL/ImageFont.py:4034 ms2.1%
draw_text_with_emojistarter_packs/splash_images.py:345 image_draw.text(2 ms1.1%
ImageDraw.textPIL/ImageDraw.py:6472 ms1.1%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:5912 ms1.1%
FreeTypeFont.getmask2PIL/ImageFont.py:6532 ms1.1%
render_conference_og_image_to_image_objconfs/og_images.py:14914 ms6.9%
_gradient_backgroundconfs/og_images.py:99 background.paste(mixed_color, (x, 0, x + 1, height))10 ms5.3%
Image.pastePIL/Image.py:19305 ms2.7%
Image.pastePIL/Image.py:19242 ms1.1%
Image.pastePIL/Image.py:19101 ms0.5%
Image.pastePIL/Image.py:18971 ms0.5%
_gradient_backgroundconfs/og_images.py:90 background = Image.new("RGBA", (width, height))3 ms1.6%
newPIL/Image.py:32393 ms1.6%
render_conference_og_image_to_image_objconfs/og_images.py:229 image = image.convert("RGB")6 ms3.2%
Image.convertPIL/Image.py:12346 ms3.2%
render_conference_og_image_to_image_objconfs/og_images.py:1936 ms3.2%
_fit_font_sizeconfs/og_images.py:643 ms1.6%
_text_widthconfs/og_images.py:543 ms1.6%
split_text_emoji_segmentsstarter_packs/splash_images.py:300 bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])2 ms1.1%
ImageDraw.textbboxPIL/ImageDraw.py:7362 ms1.1%
Text.get_bboxPIL/ImageText.py:4912 ms1.1%
Text._get_bboxPIL/ImageText.py:4552 ms1.1%
FreeTypeFont.getbboxPIL/ImageFont.py:4642 ms1.1%
split_text_emoji_segmentsstarter_packs/splash_images.py:286 segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)1 ms0.5%
ImageDraw.textlengthPIL/ImageDraw.py:7081 ms0.5%
Text.get_lengthPIL/ImageText.py:3171 ms0.5%
FreeTypeFont.getlengthPIL/ImageFont.py:4031 ms0.5%
_fit_font_sizeconfs/og_images.py:633 ms1.6%
_load_fontsconfs/og_images.py:38 main_font = ImageFont.truetype(str(MAIN_FONT_PATH), size)1 ms0.5%
truetypePIL/ImageFont.py:8851 ms0.5%
truetype.<locals>.freetypePIL/ImageFont.py:8821 ms0.5%
FreeTypeFont.__init__PIL/ImageFont.py:2981 ms0.5%
_load_fontsconfs/og_images.py:41 main_font.set_variation_by_name("Bold")1 ms0.5%
FreeTypeFont.set_variation_by_namePIL/ImageFont.py:7141 ms0.5%
FreeTypeFont.get_variation_namesPIL/ImageFont.py:7041 ms0.5%
_load_fontsconfs/og_images.py:47 ImageFont.truetype(path, size) for path in glob.glob(str(settings.BASE_DIR / "static" / "NotoSans*.ttf"))1 ms0.5%
truetypePIL/ImageFont.py:8851 ms0.5%
truetype.<locals>.freetypePIL/ImageFont.py:8821 ms0.5%
FreeTypeFont.__init__PIL/ImageFont.py:2981 ms0.5%
render_conference_og_image_to_image_objconfs/og_images.py:221 draw.text(3 ms1.6%
ImageDraw.textPIL/ImageDraw.py:6473 ms1.6%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:5913 ms1.6%
FreeTypeFont.getmask2PIL/ImageFont.py:6533 ms1.6%
render_conference_og_image_to_image_objconfs/og_images.py:2041 ms0.5%
ImageDraw.rounded_rectanglePIL/ImageDraw.py:4781 ms0.5%
ImageDraw.rounded_rectangle.<locals>.draw_cornersPIL/ImageDraw.py:4731 ms0.5%
render_conference_og_image_to_image_objconfs/og_images.py:2061 ms0.5%
draw_text_with_emojistarter_packs/splash_images.py:345 image_draw.text(1 ms0.5%
ImageDraw.textPIL/ImageDraw.py:6471 ms0.5%
ImageDraw.text.<locals>.draw_textPIL/ImageDraw.py:5911 ms0.5%
FreeTypeFont.getmask2PIL/ImageFont.py:6531 ms0.5%
render_conference_og_imageconfs/og_images.py:246 image.save(image_path)42 ms21.3%
Image.savePIL/Image.py:271142 ms21.3%
_savePIL/PngImagePlugin.py:152242 ms21.3%
_savePIL/ImageFile.py:66742 ms21.3%
_encode_tilePIL/ImageFile.py:69342 ms21.3%
render_conference_og_imageconfs/og_images.py:255 conference.save(1 ms0.5%
Model.savedjango/db/models/base.py:9041 ms0.5%
Model.save_basedjango/db/models/base.py:9961 ms0.5%
Model._save_tabledjango/db/models/base.py:11401 ms0.5%
Model._do_updatedjango/db/models/base.py:12441 ms0.5%
QuerySet._updatedjango/db/models/query.py:14481 ms0.5%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21501 ms0.5%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21211 ms0.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms0.5%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.5%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms0.5%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms0.5%
Cursor.executepsycopg/cursor.py:1131 ms0.5%
Connection.waitpsycopg/connection.py:4951 ms0.5%
TestConferenceOgImage.test_render_writes_file_and_updates_fieldsconfs/tests.py:14432 ms1.1%
TestConferenceOgImage._conferenceconfs/tests.py:1428 return baker.make(Conference, **defaults)2 ms1.1%
makemodel_bakery/baker.py:1752 ms1.1%
Baker.makemodel_bakery/baker.py:4542 ms1.1%
Baker._makemodel_bakery/baker.py:5422 ms1.1%
Baker.instancemodel_bakery/baker.py:6592 ms1.1%
Model.savedjango/db/models/base.py:9042 ms1.1%
Model.save_basedjango/db/models/base.py:9962 ms1.1%
Model._save_tabledjango/db/models/base.py:11992 ms1.1%
Model._do_insertdjango/db/models/base.py:12512 ms1.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms1.1%
QuerySet._insertdjango/db/models/query.py:21412 ms1.1%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19362 ms1.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms1.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms1.1%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms1.1%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms1.1%
Cursor.executepsycopg/cursor.py:1132 ms1.1%
Connection.waitpsycopg/connection.py:4952 ms1.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms1.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms1.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms1.1%
TestConferenceOgImage.test_render_writes_file_and_updates_fieldsconfs/tests.py:14471 ms0.5%
Model.refresh_from_dbdjango/db/models/base.py:7881 ms0.5%
QuerySet.getdjango/db/models/query.py:7021 ms0.5%
QuerySet.__len__django/db/models/query.py:4211 ms0.5%
QuerySet._fetch_alldjango/db/models/query.py:22621 ms0.5%
ModelIterable.__iter__django/db/models/query.py:1031 ms0.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms0.5%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.5%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms0.5%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms0.5%
Cursor.executepsycopg/cursor.py:1131 ms0.5%
Connection.waitpsycopg/connection.py:4951 ms0.5%
SimpleTestCase._setup_and_calldjango/test/testcases.py:3722 ms1.1%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()2 ms1.1%
TestCase._fixture_teardowndjango/test/testcases.py:14971 ms0.5%
TestCase._should_check_constraintsdjango/test/testcases.py:15061 ms0.5%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:5041 ms0.5%
Cursor.executepsycopg/cursor.py:1131 ms0.5%
Connection.waitpsycopg/connection.py:4951 ms0.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms0.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms0.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms0.5%
TestCase._fixture_teardowndjango/test/testcases.py:15001 ms0.5%
TestCase._rollback_atomicsdjango/test/testcases.py:14081 ms0.5%
Atomic.__exit__django/db/transaction.py:2951 ms0.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms0.5%
BaseDatabaseWrapper.savepoint_rollbackdjango/db/backends/base/base.py:4131 ms0.5%
BaseDatabaseWrapper._savepoint_rollbackdjango/db/backends/base/base.py:3711 ms0.5%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.5%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms0.5%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms0.5%
Cursor.executepsycopg/cursor.py:1131 ms0.5%
Connection.waitpsycopg/connection.py:4951 ms0.5%
Estimated from 187 samples; phase durations are exact. Frames from pytest and pluggy are
shown
.
Hot lines in your code
|
confs/og_images.py:230
return image.resize(RESOLUTION, resample=Image.Resampling.LANCZOS)
render_conference_og_image_to_image_obj
· Libraries
|
68 ms |
|
confs/og_images.py:246
image.save(image_path)
render_conference_og_image
· Libraries
|
42 ms |
|
starter_packs/splash_images.py:286
segments[-1]["width"] = image_draw.textlength(segments[-1]["content"], current_font)
split_text_emoji_segments
· Libraries
|
28 ms |
|
confs/og_images.py:99
background.paste(mixed_color, (x, 0, x + 1, height))
_gradient_background
· Libraries
|
10 ms |
|
starter_packs/splash_images.py:345
image_draw.text(
draw_text_with_emoji
· Libraries
|
10 ms |
|
starter_packs/splash_images.py:300
bbox = image_draw.textbbox((0, 0), segment["content"], segment["font"])
split_text_emoji_segments
· Libraries
|
8 ms |
|
confs/og_images.py:229
image = image.convert("RGB")
render_conference_og_image_to_image_obj
· Libraries
|
6 ms |
|
confs/og_images.py:90
background = Image.new("RGBA", (width, height))
_gradient_background
· Libraries
|
3 ms |
|
confs/og_images.py:221
draw.text(
render_conference_og_image_to_image_obj
· Libraries
|
3 ms |
|
confs/og_images.py:47
ImageFont.truetype(path, size) for path in glob.glob(str(settings.BASE_DIR / "static" / "NotoSans*.ttf"))
_load_fonts
· Libraries
|
3 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.05 ms |
| _template_string_if_invalid_marker function | 0.04 ms |
| _django_db_marker function | 0.03 ms |
| _django_isolate_apps function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.02 ms |
Database
8 queries · 4 msNo repeated queries.
Biggest pieces of work
|
call test body
confs/tests.py:1446
|
192 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
2 ms |
Reliability
5 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 5 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 7 hours ago | CI github-actions:test | passed | 195 ms | Profile |
| 7 hours ago | CI github-actions:test | passed | 226 ms | Profile |
| 7 hours ago | CI github-actions:test | passed | 467 ms | Profile |
| 12 hours ago | CI github-actions:test | passed | 227 ms | Profile |
| 13 hours ago | CI github-actions:test | passed | 137 ms | Run |