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

Expose a _test_utils feature to expose integration test helpers #422

Closed
4 tasks done
DanGould opened this issue Dec 2, 2024 · 2 comments
Closed
4 tasks done

Expose a _test_utils feature to expose integration test helpers #422

DanGould opened this issue Dec 2, 2024 · 2 comments

Comments

@DanGould
Copy link
Contributor

DanGould commented Dec 2, 2024

Higher layer payjoin implementations like payjoin-ffi and payjoin-flutter and the bindings they produce would make use of a _test_utils feature like rust-lightning has. The _ prefix prevents it from being a listed feature in documentation by default.

This should expose:

  • BitcoinD and wallet setup
  • payjoin-directory setup and teardown
  • ohttp-relay setup and teardown

(^ closed by ##484)

  • including ephemeral Redis containers

Then, the higher level crates can create bindings to make these available in all languages we bind to for easy test duplication downstream.

@spacebear21
Copy link
Collaborator

To do this more cleanly, i guess would suggest introducing some kind of TestServices struct, make init_directory into something that constructs that (combining with relay initialization i suppose), and endow it with informational getters for e.g. the port/host numbers, as well as the owner of the Container/docker CLI structs that need to remain alive?

#421 should probably be addressed as part of such cleanup as well

Originally posted by @nothingmuch in #388 (comment)

@DanGould DanGould added this to the payjoin-0.23 milestone Jan 20, 2025
DanGould added a commit that referenced this issue Jan 23, 2025
This is an effort to address
#422.

Commonly-used test utilities are moved to a standalone
`payjoin-test-utils` crate. This new crate also provides an opportunity
to create downstream test fixtures in payjoin-ffi and language bindings
downstream of it.

The new crate also introduces `TestServices`, which further facilitates
testing by handling common operations such as initializing a payjoin
directory and OHTTP relay, fetching OHTTP keys, etc.
@spacebear21
Copy link
Collaborator

Redis component closed by #507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants