Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release-v1.8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Brord van Wierst committed Oct 12, 2019
2 parents e1776fb + 909c7f7 commit 90ab990
Show file tree
Hide file tree
Showing 106 changed files with 4,477 additions and 2,324 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
language: java

dist: trusty

jdk:
- oraclejdk8
- openjdk8
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The IRI repository is the main IOTA Reference Implementation and the embodiment

This is a full-featured [[IOTA]](https://iota.org/) node with a convenient JSON-REST HTTP interface.
It allows users to become part of the [[IOTA]](https://iota.org) network as both a transaction relay
and network information provider through the easy-to-use [[API]](https://docs.iota.org/docs/iri/0.1/references/api-reference).
and network information provider through the easy-to-use [[API]](https://docs.iota.org/docs/node-software/0.1/iri/references/api-reference).

It is specially designed for users seeking a fast, efficient and fully-compatible network setup.

Expand Down Expand Up @@ -40,8 +40,8 @@ please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
# Documentation

This page contains basic instructions for setting up an IRI node. You can find the full documentation on:
- Our [documentation website](https://docs.iota.org/docs/iri/0.1/introduction/overview)
- [IRI API refernece](https://docs.iota.org/docs/iri/0.1/references/api-reference)
- Our [documentation website](https://docs.iota.org/docs/node-software/0.1/iri/introduction/overview)
- [IRI API reference](https://docs.iota.org/docs/node-software/0.1/iri/references/api-reference)

You can also use one of these great community guides:
- [IOTA Partners guide](https://iota.partners/)
Expand Down Expand Up @@ -80,7 +80,7 @@ or in the `iota.ini` file — e.g., '`PORT = 14265`'.
If the '`iota.ini`' file exists, it will be read.
The port and all the command line options below take precedence over values specified in the ini config file.

Here is an example script that specifies only the port, with all other setting to be read from the ini file **if it exists**:
Here is an example script that specifies only the port, with all other settings to be read from the ini file **if it exists**:

```
java -jar iri.jar -p 14265
Expand Down
9 changes: 9 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,14 @@ IOTA checkstyle draft
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="TypeName"/>
<module name="ConstantName">
<!-- Sometimes private/protected are not really constant values -->
<property name="applyToPrivate" value="false"/>
<property name="applyToProtected" value="false"/>
<!-- log is always fine -->
<property name="format"
value="^log(ger)?$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
</module>
<module name="InnerTypeLast"/>
</module>
</module>
78 changes: 33 additions & 45 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.iota</groupId>
<artifactId>iri</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
<name>IRI</name>
<description>IOTA Reference Implementation</description>

Expand All @@ -20,8 +20,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javadoc-version>3.1.0</javadoc-version>
<checkstyle-version>3.0.0</checkstyle-version>
<undertow.version>2.0.22.Final</undertow.version>
<jackson-databind.version>2.9.9.1</jackson-databind.version>
<undertow.version>2.0.23.Final</undertow.version>
<jackson-databind.version>2.9.9.2</jackson-databind.version>
<zero-allocation-hashing.version>0.8</zero-allocation-hashing.version>
<system-rules.version>1.19.0</system-rules.version>
<jacoco.version>0.7.9</jacoco.version>
Expand All @@ -33,6 +33,7 @@
<md-doclet-group>com.github.iotaledger</md-doclet-group>
<md-doclet-artifact>java-md-doclet</md-doclet-artifact>
<md-doclet-version>master-SNAPSHOT</md-doclet-version>
<guice-version>4.2.2</guice-version>
</properties>

<repositories>
Expand Down Expand Up @@ -149,6 +150,13 @@
<version>3.6.3.Final</version>
</dependency>

<!-- guice for dependency injection -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guice-version}</version>
</dependency>

<!-- test dependencies -->

<!-- https://mvnrepository.com/artifact/com.jayway.restassured/rest-assured -->
Expand Down Expand Up @@ -274,19 +282,6 @@
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
<!-- Controls how jar is being created -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<!-- The javadoc plugin can be called by running "mvn javadoc:javadoc" and will generate the classic javadoc
files in folder "target/site/apidocs" -->
<plugin>
Expand Down Expand Up @@ -317,35 +312,28 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>iri-${project.version}</finalName>
<outputDirectory>${project.basedir}/target</outputDirectory>
<archive>
<manifest>
<mainClass>com.iota.iri.IRI</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>shade</goal>
<goal>single</goal>
</goals>
<configuration>
<finalName>iri-${project.version}</finalName>
<outputDirectory>${project.basedir}/target</outputDirectory>
<mainClass>com.iota.iri.IRI</mainClass>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.iota.iri.IRI</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -414,13 +402,13 @@
com.google.code.gson:gson:2.8.1:jar:null:compile:02a8e0aa38a2e21cb39e2f5a7d6704cbdc941da0
</urn>
<urn>
io.undertow:undertow-core:${undertow.version}:jar:null:compile:61b403d76eb06b4ec40b2dacf26aa0daddb9ce5f
io.undertow:undertow-core:${undertow.version}:jar:null:compile:0ffc9206dd984c29741cab34742c2939f73f735d
</urn>
<urn>
io.undertow:undertow-servlet:${undertow.version}:jar:null:compile:172363ff298d388a2c9b3e7a3cd84d3bbda19d94
io.undertow:undertow-servlet:${undertow.version}:jar:null:compile:038479670a2493219939182d47b49061a3251015
</urn>
<urn>
io.undertow:undertow-websockets-jsr:${undertow.version}:jar:null:compile:4b9c985ef0003cd696b49f45eed89d93f30cb57a
io.undertow:undertow-websockets-jsr:${undertow.version}:jar:null:compile:ca55c266f11a3569be1d93a81427a7b541fd1a65
</urn>
<!--
not used anymore
Expand All @@ -444,7 +432,7 @@
org.bouncycastle:bcprov-jdk15on:1.58:jar:null:compile:2c9aa1c4e3372b447ba5daabade4adf2a2264b12
</urn>
<urn>
com.fasterxml.jackson.core:jackson-databind:${jackson-databind.version}:jar:null:compile:211dfab27bdd15a569247fee4690a07a177044f8
com.fasterxml.jackson.core:jackson-databind:${jackson-databind.version}:jar:null:compile:d18b4dec691df396916ecd5bd5aab99d0abdcb15
</urn>
<urn>
com.beust:jcommander:1.72:jar:null:compile:6375e521c1e11d6563d4f25a07ce124ccf8cd171
Expand Down
184 changes: 165 additions & 19 deletions python-regression/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,179 @@
Python Regression Testing
A testing suite for performance and dynamic testing of IRI
## Python Regression Testing
A testing suite for performance and dynamic testing of IRI. These tests currently only work in the `python2.7`
environment.

Aloe testing
### Aloe testing
This suite uses aloe for performing tests. Once this repository is cloned, make sure you are in the PythonRegression
directory, and install the necessary packages using:
directory. Here you can create a virtual environment to run the tests on and install the necessary packages using:

_Optional:_
```
python -m venv venv
source venv/bin/activate
```
_**Note:** Don't forget to `deactivate` once you've finished your tests_


```
pip install -e .
```
Once the packages are installed, you can run all the tests with the one line command:

### Available Tests
Machine 1 - API Tests: This machine uses 2 nodes and tests each of the api calls, and ensures that the responses are
the expected values

Machine 2 - Transaction Tests: This machine uses 2 nodes. Several zero value transactions are sent to the first node,
as well as a milestone transaction. Then node two is checked to make sure the transactions are all confirmed. After
these transactions are resolved, the same approach is used to ensure that value transactions are also being confirmed
correctly.

Machine 3 - Blowball Tests: This machine uses 6 nodes by default, but can be customized to be performed on as many/few
as desired. 1000 `getTransactionsToApprove` calls are made across these nodes, and the responses checked to make sure
that less than 5% of the results are milestone transactions. If the responses are over this threshold, then that means
blowballs are occurring.

Machine 4 - Stitching Tests: This machine uses 1 node. The node is loaded with a db containing a large side tangle. A
stitching transaction is issued, and another transaction referencing that one is issued. After these transactions are
issued, making `getTransactionsToApprove` calls should not crash the node.

Machine 5 - Milestone Validation Tests: This machine uses 2 nodes. Both nodes are loaded with the same db. The db
contains several signed milestone transactions, and several unsigned transactions. One node is set to validate the
testnet coordinator signature, while the other is not. The one that requires validation should solidify to one point,
while the other should solidify further.

Machine 6 - Local Snapshotting Tests: This machine uses 4 nodes. The first node contains the snapshot `meta` and `state`
files, the `spent-addresses-db` and `testnetdb` of a synced node. The second only contains the database, and the third
only contains the snapshot files. All three of these nodes are tested to ensure that they solidify to the same point,
and that the proper information is contained in the snapshot files and databases. The fourth node has a larger database
that contains more milestones than the `local-snapshots-pruning-depth`. This node is checked to make sure that after
starting, transactions that should be pruned from the database have been pruned correctly. This machine also includes
tests for spent addresses including a test for exporting and merging spent addresses using IXI
modules.


### Running Tests Locally

To run the tests using a local/custom node, the first step will be to define the nodes that you would like to run the
tests on. Each `aloe` test will run off of a given feature file, stored in the `./tests/features/machine[x]` directory.
The tests rely on an `output.yml` configuration file, which contains the host and port information of the nodes that
the test will be run on. The nodes you intend to test will need to be configured manually using the arguments present in
the `config.yml` file. This file needs to be generated/filled out manually for local tests. The `config.yml` and
`output.yml` files are found in the machine directory for the test.

Setting up the node you intend to test will require you to enter the arguments given for that node in the
`config.yml` file. For example, for `machine1` the `config.yml` file contains the following arguments:
```
aloe
default_args: &args
['--testnet-coordinator',
'EFPNKGPCBXXXLIBYFGIGYBYTFFPIOQVNNVVWTTIYZO9NFREQGVGDQQHUUQ9CLWAEMXVDFSSMOTGAHVIBH',
'--mwm',
'1',
'--milestone-start',
'0',
'--testnet-no-coo-validation',
'true',
'--testnet',
'true',
'--snapshot',
'./snapshot.txt',
'--local-snapshots-pruning-enabled',
'true',
'--local-snapshots-pruning-delay',
'10000'
]
```
Extra Features
If you would like a more verbose readout of the tests being run, you can add the -v flag:

So for example, when starting a node for these `machine1` tests, you would download and unpackage the db referenced
in the provided db url in the `config.yml`. Once ready, your iri start command would look like:
```
aloe -v
````
If you would like to run any particular feature file, you may enter the path to the file following the aloe command
(this can be done in conjunction with other flags as well):
java -jar iri-CURRENT-VERSION.jar -p 14265 -t 15600
--testnet-coordinator EFPNKGPCBXXXLIBYFGIGYBYTFFPIOQVNNVVWTTIYZO9NFREQGVGDQQHUUQ9CLWAEMXVDFSSMOTGAHVIBH --testnet true
--mwm 1 --milestone-start 0 --testnet-no-coo-validation true --snapshot ./snapshot.txt --local-snapshots-pruning-enabled
true --local-snapshots-pruning-delay 10000
```
aloe -v ./tests/machine1/features/machine_1_tests.feature

Once the node is running, it's time to run the tests. The `output.yml` needs to be present in the same machine folder as
the `config.yml` file and should contain the host and port details for your nodes in a structure as follows:

```
Certain features will have tags on them that can be used for inclusion or exclusion in testing. For example:
nodes:
nodeA:
host: localhost
podip: localhost
ports:
api: 14265
gossip-tcp: 15600
zmq-feed: 5556
clusterip_ports:
api: 14265
gossip-tcp: 15600
zmq-feed: 5556
nodeB:
host: localhost
podip: localhost
ports:
api: 15265
gossip-tcp: 15605
zmq-feed: 6556
clusterip_ports:
api: 15265
gossip-tcp: 15605
zmq-feed: 6556
```

Once the `output.yml` configuration is set, the tests can be run.

_**Note:** Each `machine[X]` directory will need its own unique `output.yml` to run that machines tests._


The tests will be run from the `iri/python-regression` directory. The file structure for the test you wish to write
should look as follows:

```
aloe -a utilTests
iri
-/python-regression [Where the test is run]
--/tests
---/features
----/machine1 [Same structure for other machines]
-----/1_api_tests.feature
-----/config.yml
-----/output.yml
```
and:

From the `iri/python-regression` directory, a test can be run using the following command structure:

`aloe ` _`Feature file name`_ `-w` _`Location of feature file`_ `[-v]` `[--nologcapture]`
```
-v: Verbose test name logging
--nologcapture: Release logging for individual tests for increased verbosity
```
i.e. For the api tests:
```
aloe -a '!utilTests'
aloe 1_api_tests.feature -w ./tests/features/machine1/ -v --nologcapture
```
Will run all tests that include or don't include the utilTests tag respectively (run the second command if you would
like to only run the main tests)



### Extra Features
If you would like to only run part of a feature test, flags can be input into the feature file above the `Scenario: `
lines. This flag can be whatever you would like, so long as it is preceded by an `@` symbol. For example:
```
@getNodeInfo
Scenario: Test getNodeInfo API call
```

When running the aloe command, you can add the `-a` flag to register that you would like to only run tests containing
the given attribute. Inversely you can also run all tests that do not contain that flag by using `!`. This is shown
below:
```
aloe 1_api_tests.feature -w ./tests/features/machine1 -a getNodeInfo
```
or to not run the flagged tests:
```
aloe 1_api_tests.feature -w ./tests/features/machine1 -a '!getNodeInfo'
```
_Note: To negate running the tests using the flag requires the `!` and flag to be wrapped in parentheses as shown above_

The same flag can be used for several scenarios, and they will all either be included or negated by this flag.
Loading

0 comments on commit 90ab990

Please sign in to comment.