-
Notifications
You must be signed in to change notification settings - Fork 43
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: xud-simulation migration #852
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully ran the test suites locally - good job 👍 . Didn't manage to go over the code in detail, but in general looks very nice - excited to have these run on every build and prevent bugs in the core functionality :).
GO111MODULE=on go test -v | ||
```` | ||
|
||
## Network Scenarios Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really like how much initial coverage is included.
You mentioned after merging this there will be some fixes necessary to |
@kilrau i'm not sure which fixes are you referring to. |
Would it be an option to manually install the specific go version we want via the travis script before runnings tests, instead of switching the language to Edit: I do see that we are installing the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work. In trying to run this locally, I'm getting this error:
=== RUN TestExchangeUnionDaemon
2019/03/26 09:29:33 installing dependencies...
--- FAIL: TestExchangeUnionDaemon (9.53s)
xud_test.go:155: Error outside of test: *errors.errorString installation error: starting lnd clone...
finished lnd clone
starting lnd make...
Compiling dependencies.
dep ensure -v
Makefile:116: recipe for target 'dep' failed
unable to make lnd
/home/mcnallydp_gmail_com/xud/test/simulation/xud_test.go:191 (0x9ea82c)
TestExchangeUnionDaemon: ht.Fatalf("%v", err)
/usr/local/go/src/testing/testing.go:827 (0x4f799f)
tRunner: fn(t)
/usr/local/go/src/runtime/asm_amd64.s:1333 (0x45d131)
goexit: BYTE $0x90 // NOP
FAIL
I've tried manually running go get -u github.com/golang/dep/cmd/dep
but that doesn't seem to help. Any ideas?
@@ -0,0 +1,579 @@ | |||
// Copyright 2018 The Exchange Union Developers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this and the other .proto
files, would it be possible to reference the existing files in the repository (outside the simulation
folder)? My concern is that we'd have to manually change files in two places and that they could fall out of sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I wanted to do that after the migration and forgot. the gen_protos.sh
will still need to be triggered after changes though.
@@ -31,6 +31,7 @@ | |||
"test:p2p": "mocha -r ts-node/register test/p2p/*", | |||
"test:p2p:watch": "mocha -r ts-node/register test/p2p/* --watch --watch-extensions ts", | |||
"test:crypto": "mocha -r ts-node/register test/crypto/*", | |||
"test:sim": "(cd test/simulation && GO111MODULE=on go test -v)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this won't work on Windows, something that may be worth doing here is using a cross-os script that prints something like "simulation tests not supported on windows" for windows and uses this script for linux/mac.
Installation & Usage: | ||
|
||
```bash | ||
$ GO111MODULE=on go test -v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to change this to npm run test:sim
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do it so it will be treated as independent folder to be run directly. But since we want to create a dependency with the .proto
files, I can that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed that, but didn't push yet because I wanted you to see the current travis failure status.
Misunderstanding. Just ignore what I said. |
FYI, I got past my error above (I think I needed to add to the
|
@sangaman you’re on Windows, right? if so, then there’s more work to do to make it compatible.
Probably related to filesystem permissions. Feel free to edit
TLS cert file isn't created. This is probably because If you're not on Windows, let me know. |
Can "not finding any routes" actually be a travis problem? Any ideas what else it could be? @moshababo @erkarl |
@sangaman this is a longshot, but could it be a firewall rule blocking the execution? I ran the tests again without problems on a fresh local environment. I did, however, have to allow some new firewall rules. |
@sangaman in regards to your cloud instance run failure, it looks like a filesystem error, wheres lnd is failing to create its macaroon file. In this case, you won't see any of the log folders, because these are xud logs, which didn't even start. lnd's logs are not being written to files, but I can add a support for that. Will try to investigate the "NoRouteFound" problem some more. Also, will see if manually installing go on travis won't cause issues. |
Good news - I found and fixed a problem which caused the |
Travis builds were fixed after moving back to So the PR looks ready to me. @sangaman please try run it again on your environment, and if you still have issues, let's discuss and try to debug. I don't think it should block from merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, again this is great work.
Do you know why the change to Swaps.ts was necessary? It looks to me like the code does the same thing (although I think it's better organized this way anyhow, since the block checking for the existence of routes didn't need to be in the try
block).
I agree this is ready to merge (as we've said we can deal with non-showstopper issues down the road), just needs to be squashed into 1 or 2 commits. If you can do that today @moshababo I'd say go for it, otherwise I will in the evening my time. |
@sangaman I did change the code structure a bit, but the needed change was to check lnd routes to the taker lnd pubkey, where previously it was:
having Thanks for the feedbacks, i'm merging. |
Closes #765.
This PR is migrating
xud-simulation
underxud/test/simulation
.I changed
.travis
to havelanguage: go
instead oflanguage: node_js
. Otherwisego1.7.4
is being shipped, which isn't sufficient for Go Modules.The new
.travis
file is a bit messy now, combining 2 environments. Feel free to suggest improvements.Also, please execute it on your local machine by running
npm run test:sim
(go1.11.x
installation is required).