Skip to content
Snippets Groups Projects
user avatar
Angelo Capossele authored
Adds new analysis-dashboard, improves analysis server, adds proper metrics collection and Prometheus exporter (#502)

* :recycle: Clean up

* :white_check_mark: Add TestCalculateBranchOfTransaction

* :rocket: Upgrade fpc dashboard

* :whale: Fix docker-compose

* :white_check_mark: Add TestMoveTransactionToBranch

* :white_check_mark: Add TestFork

* :white_check_mark: Add TestBookPayload

* Add test for checkPayloadSolidity

* :white_check_mark: Add TestSetTransactionPreferred

* Add more tests

* :white_check_mark: Fix Tangle test

* Feat: started implementing lucas test cases

* Feat: fixed some issued + further tests

* Feat: started adding invalid txs check

* Feat: added removal logic for invalid transactions

* Refactor: removed Println

* :white_check_mark: Add test for 2nd Reattachment

* feat: Add first value transfer integration test

* fix: fix wrong plugin name

* :white_check_mark: Add aggregated branches test cases

* Feat: added a method to generate AggregatedBranchIDs

* :art: Use GenerateAggregatedBranchID in test

* Feat: refactored delete logic

* Fix: fixed broken test

* Feat: added final test cases for invalid txs / payloads

* ja nei was gaht dän da ab

* :construction: Make FPCHeartbeat smaller

* :construction: Split vote context to fit into an FPC update

* :construction: WIP

* Value tangle concurrency tests (#451)

* Add simple concurrency test

* Add reverse and concurrent transaction and value object solidification tests and fix bug when value object was visited more than once

* Add some documentation to make tests easily understandable

* :card_box: Add FPC analysis data persistence

* :sparkles: Add Prometheus

* :white_check_mark: Update FPC test

* :rotating_light: Remove linter warning

* :rotating_light: Remove linter warnings

* :recycle: Fix event closure

* :wrench: Add prometheus config

* WIP propagation tests but fixed already couple of bugs

* Fix: fixed some bugs

* Feat: added propagation to inclusion states to tx and its outputs

* Feat: finished the propagation down to the tx and its outputs

* :construction: WIP

* :whale: update docker-network entry node

* :see_no_evil: Add .gitignore

* :chart_with_upwards_trend: Update Prometheus

* :bug: Fix MongoDB ctx bug

* WIP propagation tests and fix bugs

* :fire: Delete finalized conflicts

* Add colored tokens test

* Add value tangle test to github workflow

* fix: Fix wrong function name in comments

* refactor: Make testSnapshots disabled in default and minor tweaks

* Feat: fixed some issues and introduced a Debugger

* Refactor: added a few comments

* Split massive test file into slightly more digestible chunks

* Initial commit for metrics collections package

* Clean up propagation tests

* Feat: fixed bugs

* Feat: enabled missing tests

* Add some documentation and missing checks for aggregated branches

* :construction: WIP

* Clean up tangle tests

* adds snapshot type

* Fix: finalized wasn't propagated when a branch was rejected

* Skeleton for implementation

* Measure isSynced

* UI Improvements

* Make it compile

* Measure TPS in value tangle

* implements ReadFrom and WriteTo for Snapshot

* read in snapshot file if snapshot path is defined

* renames snapshot test file

* :construction: WIP metrics

* Measure Tips in value tangle

* :chart_with_upwards_trend: Add DBSize metric

* WIP debugging concurrency bug of death

* Measure tips in message tangle

* :chart_with_upwards_trend: Add AvgNeighborConnectionLifeTime metric

* :arrow_up: Bump hive.go

* :chart_with_upwards_trend: Add autopeering distance metric

* Feat: added more reliable fails in test case

* Fix: fixes a race condition in solidification

* :chart_with_upwards_trend: Add gossip network traffic metric

* Clean up test

* adds assets volume to integration test containers

* fixes some asserts

* adds non-working conflict integration test

* check transaction availability in partition

* renames integration test

* Measure MPS per payload type

* Measure (cumulative) total msg count and per payload

* Measure FPC number of currently active conflicts

* lower amount of peers

* Package updates

* :tada: Link valuetransfer+FPC+dashboard

* :package: Update packr

* :bug: Fix logo

* first passing version of consensus integration test

* remove debug printlns

* do all integration tests again

* increases avg. network delay fcob rule, removes debug printlns

* go mod tidy by Marie Kondō

* renames incl. state. conflict to conflicting

* go fmt tangle.go

* go fmt tangle_test, goimports dapp.go

* goimports again because the dog is sad

* run consensus integration test on the CI

* use explicit pumba version 0.7.2

* pray to the CI gods for the test to pass

* fix panic when tangle.Fork() is called

* :sparkles: Add double spend test

* :arrow_up: Update hive.go

* readd all tests again

* :chart_with_upwards_trend: Add AnalysisOutboundBytes metric

* :arrow_up: Update go.mod

* :chart_with_upwards_trend: Start setting prometheus metrics

* reset integration framework paras

* :whale: Update docker-compose

* :whale: Fix typo

* :construction: WIP

* :whale: Update docker-compose

* :arrow_up: Bump golang version

* :bug: Fix snapshot file print

* :wrench: Change client url for testing

* :bug: Remove pflag double import

* OpinionEvent struct for calling Finalized and Failed vote events

* Measure finalized/failed conflicts + average rounds of finalization

* refactor: Remove FPC page from dashboard

* refactor: Remove Drng link from dashboard

* :chart_with_upwards_trend: Add autopeering network traffic metric

* :whale: Bump up golang version

* :construction: WIP

* Measure voting queries (received, unreplied) and number of opinions

* :sparkles: Add sendPayload API

* :zap: Avoid sending empty rounds

* :chart_with_upwards_trend: Add a bunch of metrics to prometheus

* Feat: outputs inherit status of transaction

* :construction: Add Grafana integration

* Refactor: fixed erroneous rename

* :construction: WIP

* Fix: fixed missing marshaling of output bools

* Fixes after merge

* :bug: Fix some bugs

* :chart_with_upwards_trend: Prometheus FPC data collection

* :art: Small fixes

* Fix: fixed decision pending

* :chart_with_upwards_trend: Prometheus Tangle metrics data collection

* :recycle: Refactor FPC metric events

* :arrow_up: Bump up hive.go

* :sparkles: Add metric heartbeat packet

* :chart_with_upwards_trend: Add clients metrics collection via the analysis server

* :construction: WIP

* Prometheus clients info

* Fix metrics config + enable prometheus collection on entry_node

* use new protocol

* wip: redial on lost connection

* assure conn is not nil

* close on write

* Fix bugs + enable spammer on peer_master

* Fix analysis fpc livefeed bug

* connector cleanup

* :chart_with_upwards_trend: Autopeering NeighborCount + Network Diameter metrics

* do not log the dial error since the logger might not available

* removes test snapshot plugin

* :zap: Improve analysis-server

* :loud_sound: Change log to debug level

* graph pkg from autopeering-sim

* Remove debug line + hive.go update

* :arrow_up: Change hive.go version

* get rid of test snapshot plugin

* fixes wrong use of Println

* removes random tool

* :bug: Move conn initialization

* removes duplicated value entry in GH CI workflows

* :arrow_up: Update hive.go

* :recycle: Clean go.mod

* :rotating_light: Fix graph pkg linter warnings

* :recycle: improve analysis plugin

* :rotating_light: Fix metrics plugin linter warning

* xxx

* wip

* fixes integration test

* :chart_with_upwards_trend: Add FPC global metrics to prometheus

* :bug: Fix double register

* :rotating_light: Fix client pkg linter warning

* :rotating_light: Fix webapi linter warnings

* :ambulance: Run you fools!

* :white_check_mark: Fix testutil import

* Adjust inbox worker pool capacity to default

* Adjust inbox worker pool capacity to default (#505)

* :ok_hand: Address PR review comments

* :dog: Fix watch dog warnings

* :bone: Let's try with a new bone for the dog now..

* upgrade hive.go to master

* :bug: Fix local dashboard

* :zap: Improves mongoDB reliabilty

* :rotating_light: Fix linter warnings

* :white_check_mark: Fix test

* :chart_with_upwards_trend: Make dbSize a prometheus Gauge

* :recycle:

 Remove unecessary initialization

* introduce worker pool for storing finalized vote ctxs

* Update packr

* type alias FPCRecords to []FPCRecord

Co-authored-by: default avatarjonastheis <mail@jonastheis.de>
Co-authored-by: default avatarHans Moog <hm@mkjc.net>
Co-authored-by: default avatarjkrvivian <jkrvivian@gmail.com>
Co-authored-by: default avatarLuca Moser <moser.luca@gmail.com>
Co-authored-by: default avatarLevente Pap <levente.pap@iota.org>
Co-authored-by: default avatarMartyn Janes <martyn@obany.com>
Co-authored-by: default avatarWolfgang Welz <welzwo@gmail.com>
f4b7f3f8
History
Name Last commit Last update
..
assets
logs
tester
README.md
runTests.sh

Integration tests with Docker

Integration testing

Running the integration tests spins up a tester container within which every test can specify its own GoShimmer network with Docker as schematically shown in the figure above.

Peers can communicate freely within their Docker network and this is exactly how the tests are run using the tester container. Test can be written in regular Go style while the framework provides convenience functions to create a new network, access a specific peer's web API or logs.

How to run

Prerequisites:

  • Docker 17.12.0+
  • Docker compose: file format 3.5
# Mac & Linux
./runTests.sh

The tests produce *.log files for every networks' peer in the logs folder after every run.

On GitHub logs of every peer are stored as artifacts and can be downloaded for closer inspection once the job finishes.

Creating tests

Tests can be written in regular Go style. Each tested component should reside in its own test file in tester/tests. main_test with its TestMain function is executed before any test in the package and initializes the integration test framework.

Each test has to specify its network where the tests are run. This can be done via the framework at the beginning of a test.

// create a network with name 'testnetwork' with 6 peers and wait until every peer has at least 3 neighbors
n := f.CreateNetwork("testnetwork", 6, 3)
// must be called to create log files and properly clean up
defer n.Shutdown() 

Other tips

Useful for development is to only execute the test you're currently building. For that matter, simply modify the docker-compose.yml file as follows:

entrypoint: go test ./tests -run <YOUR_TEST_NAME> -v -mod=readonly