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

test: e2e, add new public-ln-receive.bats #3657

Closed

Conversation

Ayush170-Future
Copy link

This PR adds the new e2e test public-ln-receive in bats/core/api and deletes the old one from core/api.

I added a new function in the helpers and made some adjustments in the test file to align with the new helper.

@Ayush170-Future
Copy link
Author

The CI failure seems unrelated. Any suggestions to fix this? Or are these fine for test files?

@vindard
Copy link
Contributor

vindard commented Dec 5, 2023

The CI failure seems unrelated. Any suggestions to fix this? Or are these fine for test files?

That is strange. I'll look into them and let you know on here. For the quickstart one, it looks like it can't handle commit references outside our repo. I'll see if I can fix that.

@vindard
Copy link
Contributor

vindard commented Dec 6, 2023

The CI failure seems unrelated. Any suggestions to fix this? Or are these fine for test files?

Ok we'll fix the quickstart failure in #3661, but the new bats tests themselves are genuinely broken still too. Are you able to execute these tests locally from bats/core/api/public-ln-receive.bats and confirm they work?

From top level of dir:

  1. In one terminal window run: buck2 run //dev:down && buck2 run //dev:up
  2. Wait for api resource to come up at localhost:10350 in your browser
  3. In a separate terminal window test with: bats -t bats/core/api/public-ln-receive.bats

@Ayush170-Future
Copy link
Author

Yeah, just give me some time to confirm it. If it doesn't pass, I'll push the fix as soon as possible. Thanks for your quick responses!

@Ayush170-Future
Copy link
Author

I think I understand the problem here. Will force-push the fix soon!

@Ayush170-Future Ayush170-Future marked this pull request as draft December 6, 2023 22:54
@Ayush170-Future
Copy link
Author

I've made this PR a draft while I work on this. Will open for review soon.

@Ayush170-Future Ayush170-Future marked this pull request as ready for review December 9, 2023 12:22
@Ayush170-Future
Copy link
Author

  • Rebased to the main
  • Updated the ln.bash with necessary functions.

@vindard I suspect there might be some problem with the query formatting in exec_graphql.

@vindard
Copy link
Contributor

vindard commented Dec 9, 2023

  • Rebased to the main

    • Updated the ln.bash with necessary functions.

@vindard I suspect there might be some problem with the query formatting in exec_graphql.

Ok as far as I can tell you won't even get past the lnds_init step in setup_file because we deliberately don't have an lnd2 container setup in Tiltfile so far.

Also, ln-no-amount-invoice-create.gql is missing in latest push which breaks a later step in setup_file too.

image


Notes

I would recommend taking this PR a bit more slowly. The way I would do it is to just start with a single @test case and to then only bring in the exact functions you'd need in ln.bash, if any.

Get that to pass, commit, and then continue to subsequent test cases. For example, the very first @test "public-ln-receive: account details - can fetch with btc default wallet-id from username" doesn't even need lnds initialised to work.

Smaller granular commits that each pass the test that you're adding are usually better for building up large test suites like this one with heavy dependencies.

Also, I expect when you get to the 1st test that actually needs lnds (@test "public-ln-receive: receive via invoice - can receive on btc invoice, with subscription"), we will be setting up the lnds via an "init script" vs. having a function called lnds_init in ln.bash (see this comment)

It would be similar to how we:

@vindard
Copy link
Contributor

vindard commented Dec 29, 2023

Taken over by #3765

@vindard vindard closed this Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants