Page MenuHomePhabricator

[buildbot] Migrate out of flask.JSONEncoder
ClosedPublic

Authored by Fabien on Apr 27 2023, 12:30.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC4852cf7a80e1: [buildbot] Migrate out of flask.JSONEncoder
Summary

This is deprecated since flask 2.2, so let's use the new paradigm.

Test Plan
./contrib/teamcity/build-configurations.py check-buildbot

Diff Detail

Repository
rABC Bitcoin ABC
Branch
buildbot_deprecation
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23517
Build 46653: Build Diffcheck-buildbot
Build 46652: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Apr 27 2023, 12:30

Failed tests logs:

====== test_endpoint_backportcheck.top_level_collect ======
test_endpoint_backportcheck.py:None (test_endpoint_backportcheck.py)
test_endpoint_backportcheck.py:9: in <module>
    from test.abcbot_fixture import ABCBotFixture
abcbot_fixture.py:14: in <module>
    import test.mocks.fixture
mocks/fixture.py:29: in <module>
    class MockJSONProvider(JSONProvider):
mocks/fixture.py:33: in MockJSONProvider
    def loads(self, s: str | bytes, **kwargs):
E   TypeError: unsupported operand type(s) for |: 'type' and 'type'
====== test_endpoint_build.top_level_collect ======
test_endpoint_build.py:None (test_endpoint_build.py)
test_endpoint_build.py:10: in <module>
    from test.abcbot_fixture import ABCBotFixture
abcbot_fixture.py:14: in <module>
    import test.mocks.fixture
mocks/fixture.py:29: in <module>
    class MockJSONProvider(JSONProvider):
mocks/fixture.py:33: in MockJSONProvider
    def loads(self, s: str | bytes, **kwargs):
E   TypeError: unsupported operand type(s) for |: 'type' and 'type'
====== test_endpoint_buildDiff.top_level_collect ======
test_endpoint_buildDiff.py:None (test_endpoint_buildDiff.py)
test_endpoint_buildDiff.py:11: in <module>
    from test.abcbot_fixture import ABCBotFixture
abcbot_fixture.py:14: in <module>
    import test.mocks.fixture
mocks/fixture.py:29: in <module>
    class MockJSONProvider(JSONProvider):
mocks/fixture.py:33: in MockJSONProvider
    def loads(self, s: str | bytes, **kwargs):
E   TypeError: unsupported operand type(s) for |: 'type' and 'type'
====== test_endpoint_getCurrentUser.top_level_collect ======
test_endpoint_getCurrentUser.py:None (test_endpoint_getCurrentUser.py)
test_endpoint_getCurrentUser.py:8: in <module>
    from test.abcbot_fixture import TEST_USER, ABCBotFixture
abcbot_fixture.py:14: in <module>
    import test.mocks.fixture
mocks/fixture.py:29: in <module>
    class MockJSONProvider(JSONProvider):
mocks/fixture.py:33: in MockJSONProvider
    def loads(self, s: str | bytes, **kwargs):
E   TypeError: unsupported operand type(s) for |: 'type' and 'type'
====== test_endpoint_land.top_level_collect ======
test_endpoint_land.py:None (test_endpoint_land.py)
test_endpoint_land.py:8: in <module>
    import test.mocks.fixture
mocks/fixture.py:29: in <module>
    class MockJSONProvider(JSONProvider):
mocks/fixture.py:33: in MockJSONProvider
    def loads(self, s: str | bytes, **kwargs):
E   TypeError: unsupported operand type(s) for |: 'type' and 'type'
====== test_endpoint_status.top_level_collect ======
test_endpoint_status.py:None (test_endpoint_status.py)
test_endpoint_status.py:8: in <module>
    import test.mocks.fixture
mocks/fixture.py:29: in <module>
    class MockJSONProvider(JSONProvider):
mocks/fixture.py:33: in MockJSONProvider
    def loads(self, s: str | bytes, **kwargs):
E   TypeError: unsupported operand type(s) for |: 'type' and 'type'
====== test_endpoint_triggerCI.top_level_collect ======
test_endpoint_triggerCI.py:None (test_endpoint_triggerCI.py)
test_endpoint_triggerCI.py:12: in <module>
    from test.abcbot_fixture import ABCBotFixture
abcbot_fixture.py:14: in <module>
    import test.mocks.fixture
mocks/fixture.py:29: in <module>
    class MockJSONProvider(JSONProvider):
mocks/fixture.py:33: in MockJSONProvider
    def loads(self, s: str | bytes, **kwargs):
E   TypeError: unsupported operand type(s) for |: 'type' and 'type'
====== test_persist_database.top_level_collect ======
test_persist_database.py:None (test_persist_database.py)
test_persist_database.py:12: in <module>
    from test.abcbot_fixture import ABCBotFixture
abcbot_fixture.py:14: in <module>
    import test.mocks.fixture
mocks/fixture.py:29: in <module>
    class MockJSONProvider(JSONProvider):
mocks/fixture.py:33: in MockJSONProvider
    def loads(self, s: str | bytes, **kwargs):
E   TypeError: unsupported operand type(s) for |: 'type' and 'type'

Each failure log is accessible here:
test_endpoint_backportcheck.top_level_collect
test_endpoint_build.top_level_collect
test_endpoint_buildDiff.top_level_collect
test_endpoint_getCurrentUser.top_level_collect
test_endpoint_land.top_level_collect
test_endpoint_status.top_level_collect
test_endpoint_triggerCI.top_level_collect
test_persist_database.top_level_collect

Fabien planned changes to this revision.Apr 27 2023, 13:06

Dont use typing expressions from python >= 3.10

This revision is now accepted and ready to land.Apr 27 2023, 13:41
This revision was automatically updated to reflect the committed changes.