Page MenuHomeSoftware Heritage

Refactor origin node functional tests
ClosedPublic

Authored by jayeshv on Jun 14 2022, 3:10 PM.

Diff Detail

Repository
rDGQL GraphQL API
Branch
test-refactoring-origin-node
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 29876
Build 46701: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 46700: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D7990 (id=28780)

Rebasing onto 67e0bf7370...

Current branch diff-target is up to date.
Changes applied before test
commit 54de0981d434ede458efd2e91b95391120b39bc5
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Tue Jun 14 15:08:35 2022 +0200

    Refactor origin node functional tests

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

ardumont added inline comments.
swh/graphql/tests/functional/test_origin_node.py
25–49

That's what i actually proposed to you a while back but you used f-string instead ¯\_(ツ)_/¯.
I was probably unclear.

See [1] for a concrete example you can reproduce.

That form allows to convey much more readable information especially in cases where there are multiple variables in the templated string.
But i won't push too much for this. As you want.

Cheers,

[1]

In [4]: "hello {foo}!".format(foo="world")
Out[4]: 'hello world!'

works with any strings, including """ string """ ones.

swh/graphql/tests/functional/test_origin_node.py
25–49

Thanks @ardumont . There is another issue here, The query has '{' and '}' char in the body itself, so I'm forced to use double '{' for this to work with .format or f-strings. Hence I added the old style string manipulation.
Do you know some workaround for this?

vlorentz added inline comments.
swh/graphql/tests/functional/test_origin_node.py
25–49

@ardumont the end goal is to replace all interpolations with query variables (T4306)

This revision is now accepted and ready to land.Jun 15 2022, 1:53 PM

Build is green

Patch application report for D7990 (id=28794)

Rebasing onto 66c55a2f30...

Current branch diff-target is up to date.
Changes applied before test
commit 04b81ece1bfd584e1e6a3afbaabd405e3222db76
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Tue Jun 14 15:08:35 2022 +0200

    Refactor origin node functional tests
    
    Replace f-strings with query variables
    Related to T4306

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

This revision was automatically updated to reflect the committed changes.
  • List Item
swh/graphql/tests/functional/test_origin_node.py
25–49

ack