Page MenuHomeSoftware Heritage

test_rpc_client: Add missing RPCClient exception handling tests
ClosedPublic

Authored by anlambert on Fri, Nov 20, 3:13 PM.

Details

Summary

Related to D4542, those missing tests let a mistake pass through.

Update: I also add tests for backward compatibility with old encoded exception schema and I found another bug that I fixed in a dedicated commit.

Updated coverage report for impacted source file: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/152/coverage/cobertura__coverage_xml/project/api/api___init___py/

Diff Detail

Repository
rDCORE Foundations and core functionalities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert created this revision.Fri, Nov 20, 3:13 PM

Build is green

Patch application report for D4546 (id=16120)

Rebasing onto 7722df9f29...

First, rewinding head to replay your work on top of it...
Applying: test_rpc_client: Add missing RPCClient exception handling tests
Changes applied before test
commit 7fb0447eca6dc3607eec0f1b8287a3344232c779
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Nov 20 15:09:26 2020 +0100

    test_rpc_client: Add missing RPCClient exception handling tests

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/149/ for more details.

anlambert edited the summary of this revision. (Show Details)Fri, Nov 20, 3:17 PM
anlambert updated this revision to Diff 16134.Fri, Nov 20, 4:28 PM

Update: Fix a backward compatibility issue with old encoded exception schema and update tests accordingly

Build is green

Patch application report for D4546 (id=16134)

Rebasing onto a64357b272...

First, rewinding head to replay your work on top of it...
Applying: RPCClient: Ensure backward compatibility with old encoded exception schema
Applying: test_rpc_client: Add missing RPCClient exception handling tests
Changes applied before test
commit 61e04f931c1f8de0a234af7aaba232e10c72cb55
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Nov 20 16:27:44 2020 +0100

    test_rpc_client: Add missing RPCClient exception handling tests

commit a88edcac73e9278eb89893e157917ae07be00028
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Nov 20 16:27:14 2020 +0100

    RPCClient: Ensure backward compatibility with old encoded exception schema

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/152/ for more details.

anlambert edited the summary of this revision. (Show Details)Fri, Nov 20, 4:37 PM
vlorentz accepted this revision.Fri, Nov 20, 11:11 PM
vlorentz added a subscriber: vlorentz.

Cool, thanks!

swh/core/api/tests/test_rpc_client.py
148–150 ↗(On Diff #16134)

with a docstring, explaining it raises a generic RemoteException because Exception isn't whitelisted

This revision is now accepted and ready to land.Fri, Nov 20, 11:11 PM
anlambert updated this revision to Diff 16161.Mon, Nov 23, 11:21 AM

Update: Rebase, improve TODO comments and add docstrings for new tests.

Build is green

Patch application report for D4546 (id=16161)

Rebasing onto a64357b272...

Current branch diff-target is up to date.
Changes applied before test
commit ea81c12f2603fe936f1ca2f133eb106984edc307
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Nov 20 16:27:44 2020 +0100

    test_rpc_client: Add missing RPCClient exception handling tests

commit 47b5ab1ad5c970d2beb5e8e03b7da5d2fe56099e
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Nov 20 16:27:14 2020 +0100

    RPCClient: Ensure backward compatibility with old encoded exception schema

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/155/ for more details.

anlambert updated this revision to Diff 16162.Mon, Nov 23, 11:23 AM

Fix typos in docstrings

Build is green

Patch application report for D4546 (id=16162)

Rebasing onto a64357b272...

Current branch diff-target is up to date.
Changes applied before test
commit 7b38110bcaa0a014f1befa98d5b693b5825e7e85
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Nov 20 16:27:44 2020 +0100

    test_rpc_client: Add missing RPCClient exception handling tests

commit 47b5ab1ad5c970d2beb5e8e03b7da5d2fe56099e
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Nov 20 16:27:14 2020 +0100

    RPCClient: Ensure backward compatibility with old encoded exception schema

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/156/ for more details.