Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Goshimmer_without_tipselection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COLLET Ismael
Goshimmer_without_tipselection
Commits
1525148f
Unverified
Commit
1525148f
authored
5 years ago
by
jonastheis
Browse files
Options
Downloads
Patches
Plain Diff
Add readme
parent
5673ae79
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
images/integration-testing-setup.png
+0
-0
0 additions, 0 deletions
images/integration-testing-setup.png
tools/integration-tests/README.md
+48
-2
48 additions, 2 deletions
tools/integration-tests/README.md
tools/integration-tests/runTests.sh
+1
-1
1 addition, 1 deletion
tools/integration-tests/runTests.sh
with
49 additions
and
3 deletions
images/integration-testing-setup.png
0 → 100644
+
0
−
0
View file @
1525148f
51.7 KiB
This diff is collapsed.
Click to expand it.
tools/integration-tests/README.md
+
48
−
2
View file @
1525148f
# Integration tests with Docker

Running the integration tests spins up a GoShimmer network within Docker as schematically shown in the figure above.
`N`
defines the number of
`peer_replicas`
and can be specified when running the network.
The peers can communicate freely within the 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 access a specific peer's web API or logs.
The visualizer,
`master_peer's`
dashboard and web API are reachable from the host system on the respective ports.
The different containers (
`entry_node`
,
`peer_master`
,
`peer_replica`
) load separate config files that can be modified as necessary, respectively.
## How to run
Prerequisites:
-
Docker
-
Docker compose
```
# Mac & Linux
./runTests.sh
```
The tests produce
`*.log`
files for every peer in the
`logs`
folder after every run.
Currently, the integration tests are configured to run on every push to GitHub with
`peer_replica=5`
.
The 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.
## Use as development tool
Using a standalone throwaway Docker network can be really helpful as a development tool as well.
Reachable from the host system
-
visualizer: http://localhost:9000
-
`master_peer's`
dashboard: http: http://localhost:8081
-
`master_peer's`
web API: http: http://localhost:8080
It is therefore possible to send messages to the local network via the
`master_peer`
and observe log messages either
via
`docker logs --follow CONTAINER`
or by starting the Docker network without the
`-d`
option, as follows.
```
docker-compose -f docker-compose.yml up --scale peer_replica=5
# 1. test manually with master_peer
# 2. or run in separate terminal window
docker-compose -f tester/docker-compose.yml up --exit-code-from tester
```
docker-compose up --scale peer_replica=2
```
\ No newline at end of file
Sometimes when changing files, either in the tests or in GoShimmer, Docker does not detect the changes on a rebuild.
Then the option
`--build`
needs to be used with
`docker-compose`
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tools/integration-tests/runTests.sh
+
1
−
1
View file @
1525148f
...
...
@@ -8,7 +8,7 @@ fi
REPLICAS
=
$1
echo
"Build GoShimmer Docker network"
docker-compose
-f
docker-compose.yml up
-d
--scale
peer_replica
=
$
1
docker-compose
-f
docker-compose.yml up
-d
--scale
peer_replica
=
$
REPLICAS
if
[
$?
-ne
0
]
;
then
{
echo
"Failed, aborting."
;
exit
1
;
}
fi
echo
"Dispay containers"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment