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

services/horizon: Move integration tests away from stellar/quickstart. #3143

Merged
merged 46 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b8bda97
Use Protocol 14 in standalone core setup
Shaptic Oct 20, 2020
2ba097b
Attempt to get tests to use Docker Compose over stellar/quickstart
Shaptic Oct 20, 2020
ede737e
Fix shadowed variable (thx go vet)
Shaptic Oct 20, 2020
068b06a
Update Go modules to latest versions
Shaptic Oct 20, 2020
11800e6
Add some small cleanups & comments
Shaptic Oct 20, 2020
104de46
Avoid directory traversal entirely, preferring absolute paths
Shaptic Oct 20, 2020
0cd8f9a
Allow protocol version to be configurable
Shaptic Oct 20, 2020
c0399b6
Should fix the CI name resolution error & improves env setup
Shaptic Oct 20, 2020
843c346
Reduce verbosity
Shaptic Oct 20, 2020
d38381d
Make version check more generic
Shaptic Oct 20, 2020
86b0453
Merge branch 'master' into no-more-quickstart
Shaptic Oct 21, 2020
246e625
Drop unnecessary method
Shaptic Oct 22, 2020
22197a8
Clean up errors, path handling, and hostname resolution
Shaptic Oct 22, 2020
52a5a23
Drop more unneeded docker stuff
Shaptic Oct 22, 2020
0833a95
Undo the changes to module dependencies
Shaptic Oct 22, 2020
71b9a0a
Okay so not *every*thing docker related is useless
Shaptic Oct 22, 2020
6c2e103
Drop docker dependencies entirely
Shaptic Oct 26, 2020
7d59244
Merge branch 'master' into no-more-quickstart
Shaptic Oct 26, 2020
22bd660
wow this is complicated
Shaptic Oct 26, 2020
87a6a03
Fix integration test commands
tamirms Oct 27, 2020
94cc6b9
Merge branch 'master' into no-more-quickstart
tamirms Oct 27, 2020
9d90135
Handle captive-core runs a little more graciously
Shaptic Oct 27, 2020
dcbd30e
Merge branch 'master' into no-more-quickstart
tamirms Oct 28, 2020
1991398
Add manual close configuration for docker-compose
tamirms Oct 28, 2020
1c4aca5
go mod tidy
tamirms Oct 28, 2020
cb5b186
update go.list
tamirms Oct 28, 2020
daaf14b
Fix static check
tamirms Oct 28, 2020
2c99d4f
log failures to close core ledger
tamirms Oct 28, 2020
fa5a658
Merge branch 'master' into no-more-quickstart
tamirms Oct 28, 2020
3cfa97b
Fix failures
tamirms Oct 29, 2020
1a7039c
Merge branch 'master' into no-more-quickstart
Shaptic Oct 29, 2020
a80c521
Whoops, resolved the `master` merge conflicts the wrong way
Shaptic Oct 29, 2020
ed67c5f
Simplify tests by using dedicated yaml config for integration tests
tamirms Oct 30, 2020
016c91e
fix Still Ingesting errors
tamirms Oct 30, 2020
2545834
Fix dump ledger state script (#3177)
tamirms Oct 30, 2020
0c0d0b7
Update comments, enhance compose file lookup, and move it to a helper
Shaptic Nov 3, 2020
a5096f4
Merge branch 'master' into no-more-quickstart
Shaptic Nov 3, 2020
1223613
Appease `go vet` like the Allies did
Shaptic Nov 3, 2020
34c5830
Add logs to debug still ingesting error
tamirms Nov 3, 2020
027a48c
Clear ledgerstate between test runs
tamirms Nov 3, 2020
44370a3
Use protocol 15 in docker-compose standalone config
tamirms Nov 3, 2020
854d694
Merge branch 'master' into no-more-quickstart
tamirms Nov 4, 2020
c6623f0
Merge branch 'master' into no-more-quickstart
tamirms Nov 4, 2020
7332b14
Update services/horizon/docker/docker-compose.standalone.yml
tamirms Nov 5, 2020
1d00fe3
Set ports to integers not strings
tamirms Nov 5, 2020
8deece7
Merge branch 'master' into no-more-quickstart
tamirms Nov 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ commands:
# Pulling the image helps with test running time
command: |
cd ~/go/src/github.com/stellar/go
docker pull stellar/quickstart:testing
echo 127.0.0.1 host.docker.internal | sudo tee -a /etc/hosts
<<# parameters.enable-captive-core >>HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE=true<</ parameters.enable-captive-core >> go test -timeout 20m -v ./services/horizon/internal/integration/...

#-----------------------------------------------------------------------------#
Expand Down
13 changes: 8 additions & 5 deletions go.list
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,20 @@ github.com/yalp/jsonpath v0.0.0-20150812003900-31a79c7593bb
github.com/yudai/gojsondiff v0.0.0-20170107030110-7b1b7adf999d
github.com/yudai/golcs v0.0.0-20150405163532-d1c525dea8ce
github.com/yudai/pp v2.0.1+incompatible
github.com/yuin/goldmark v1.2.1
github.com/ziutek/mymysql v1.5.4
go.opencensus.io v0.20.1
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/exp v0.0.0-20190121172915-509febef88a4
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297
golang.org/x/mod v0.3.0
golang.org/x/net v0.0.0-20200822124328-c89045814202
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd
golang.org/x/text v0.3.3
golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c
golang.org/x/tools v0.0.0-20201019175715-b894a3290fff
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
Shaptic marked this conversation as resolved.
Show resolved Hide resolved
google.golang.org/api v0.3.1
google.golang.org/appengine v1.6.1
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ require (
github.com/yudai/golcs v0.0.0-20150405163532-d1c525dea8ce // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
github.com/ziutek/mymysql v1.5.4 // indirect
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c // indirect
golang.org/x/tools v0.0.0-20201019175715-b894a3290fff // indirect
google.golang.org/api v0.3.1
google.golang.org/appengine v1.6.1 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
Expand Down
25 changes: 19 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,23 @@ github.com/yudai/golcs v0.0.0-20150405163532-d1c525dea8ce h1:888GrqRxabUce7lj4Oa
github.com/yudai/golcs v0.0.0-20150405163532-d1c525dea8ce/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI=
github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
go.opencensus.io v0.20.1 h1:pMEjRZ1M4ebWGikflH7nQpV6+Zr88KBMA2XJD3sbijw=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4=
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand All @@ -270,8 +274,9 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand All @@ -280,6 +285,7 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -291,6 +297,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c h1:+EXw7AwNOKzPFXMZ1yNjO40aWCh3PIquJB2fYlv9wcs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
Expand All @@ -303,8 +311,13 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c h1:KfpJVdWhuRqNk4XVXzjXf2KAV4TBEP77SYdFGjeGuIE=
golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201019175715-b894a3290fff h1:HiwHyqQ9ttqCHuTa++R4wNxOg6MY1hduSDT8j2aXoMM=
golang.org/x/tools v0.0.0-20201019175715-b894a3290fff/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
Expand Down
6 changes: 3 additions & 3 deletions services/horizon/docker/docker-compose.standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ services:
environment:
- HISTORY_ARCHIVE_URLS=http://host.docker.internal:1570
- NETWORK_PASSPHRASE=Standalone Network ; February 2017
# this container will invoke a request to upgrade stellar core to protocol 13
# this container will invoke a request to upgrade stellar core to protocol 14 (by default)
tamirms marked this conversation as resolved.
Show resolved Hide resolved
core-upgrade:
restart: on-failure
image: curlimages/curl:7.69.1
command: ["-v", "-f", "http://host.docker.internal:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=13"]
command: ["-v", "-f", "http://host.docker.internal:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=${PROTOCOL_VERSION:-14}"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can upgrade to the latest version available if it's not set?

network_mode: '${NETWORK_MODE:-bridge}'

14 changes: 7 additions & 7 deletions services/horizon/internal/integration/protocol14_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func TestProtocol14Basics(t *testing.T) {
t.Run("Sanity", func(t *testing.T) {
root, err := itest.Client().Root()
tt.NoError(err)
tt.Equal(int32(14), root.CoreSupportedProtocolVersion)
tt.Equal(int32(14), root.CurrentProtocolVersion)
tt.LessOrEqual(int32(14), root.CoreSupportedProtocolVersion)
tt.LessOrEqual(int32(14), root.CurrentProtocolVersion)

// Submit a simple tx
op := txnbuild.Payment{
Expand Down Expand Up @@ -94,11 +94,11 @@ func TestHappyClaimableBalances(t *testing.T) {
a, b, c := keys[0], keys[1], keys[2]
accountA, accountB, accountC := accounts[0], accounts[1], accounts[2]

/*
* Each sub-test is completely self-contained: at the end of the test, we
* start with a clean slate for each account. This lets us check with
* equality for things like "number of operations," etc.
*/
//
// Each sub-test is completely self-contained: at the end of the test, we
// start with a clean slate for each account. This lets us check with
// equality for things like "number of operations," etc.
//

// We start simple: native asset, single destination, no predicate.
t.Run("Simple/Native", func(t *testing.T) {
Expand Down
Loading