Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 6 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
# specify versions to test
INT_NODECORE_VERSION: "0.4.13-rc.14"
INT_APM_VERSION: "0.4.13-rc.13"
INT_BTCSQ_VERSION: "master-47363b0"
INT_LOG_LEVEL: "DEBUG"

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@ scripts/certs/

certs/
*.iml
*.prefs
*.prefs

reports
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# pop-integration-int

This repository contains e2e test framework for POP protocol.

To run all tests: `./gradlew build test`

Each test uses testcontainers to start docker images of NodeCore, APM, BTCSQ (and other stuff) to test everything end-to-end.

## Environment variables

Tests will use either default versions (see [BaseIntegrationTest.kt](./src/main/kotlin/testframework/BaseIntegrationTest.kt)) or specified in following environment variables:

- INT_NODECORE_VERSION - veriblock version (https://hub.docker.com/r/veriblock/nodecore)
- INT_APM_VERSION - APM version (https://hub.docker.com/r/veriblock/altchain-pop-miner)
- INT_BTCSQ_VERSION - BTCSQ version (https://hub.docker.com/r/veriblock/btcsq)
- INT_LOG_LEVEL: "DEBUG"

Example: [ci.yml](./.github/workflows/main.yml)

## Development guide

Each service (APM/NC/BTCSQ) is organized into "wrapper" - [./src/main/kotlin/testframework/wrapper](./src/main/kotlin/testframework/wrapper).
Each wrapper is expected to provide all necessary tools to start / stop and control wrapped tool via API (HTTP/GRPC...).

Every test defines a "topology" - a set of "wrappers" to run, their relations (for example, APM should be added after NC and BTCSQ).

[ExampleTest.kt](./src/test/kotlin/functional/ExampleTest.kt)
65 changes: 53 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.SHORT
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.adarshr.gradle.testlogger.TestLoggerExtension
import com.adarshr.gradle.testlogger.TestLoggerPlugin
import com.adarshr.gradle.testlogger.theme.ThemeType

plugins {
idea
kotlin("jvm") version "1.5.31"
id("com.adarshr.test-logger") version "3.1.0"
}

group = "org.veriblock"
Expand All @@ -14,32 +17,32 @@ repositories {
maven("https://jitpack.io")
}

val kotestVersion = "4.6.3"
val kotestVersion = "5.0.1"
val coroutinesVersion = "1.5.2-native-mt"
val log4jVersion= "2.14.1"
val ktorVersion = "1.6.4"
val log4jVersion = "2.16.0"
val ktorVersion = "1.6.0"

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutinesVersion")
implementation("io.github.microutils:kotlin-logging:2.0.11")
implementation("io.github.microutils:kotlin-logging:2.1.16")
implementation("org.apache.logging.log4j:log4j-api:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-core:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.0")
implementation("com.google.code.gson:gson:2.8.8")
implementation("com.google.code.gson:gson:2.8.9")
implementation("io.ktor:ktor-client:$ktorVersion")
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-auth:$ktorVersion")
implementation("io.ktor:ktor-client-gson:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.0")
implementation("org.testcontainers:testcontainers:1.16.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.1")
implementation("org.testcontainers:testcontainers:1.16.2")
implementation("com.google.guava:guava:31.0.1-jre")
implementation("com.github.veriblock.nodecore:nodecore-grpc:v0.4.13-rc.2")
implementation("com.github.veriblock.nodecore:veriblock-extensions:v0.4.13-rc.2")
implementation("com.github.veriblock.nodecore:vpm-mock:v0.4.13-rc.2")
implementation("io.github.microutils:kotlin-logging:2.0.11")
implementation("io.github.microutils:kotlin-logging:2.1.16")
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation(kotlin("test"))
Expand All @@ -48,8 +51,6 @@ dependencies {
tasks.test {
useJUnitPlatform()
maxParallelForks = 1
testLogging.showStandardStreams = true
testLogging.exceptionFormat = SHORT
}

tasks.withType<KotlinCompile> {
Expand All @@ -62,4 +63,44 @@ tasks.withType<JavaCompile> {

tasks.withType<Test> {
useJUnitPlatform()

reports {
html.required.set(true)
junitXml.required.set(true)
junitXml.apply {
isOutputPerTestCase = true // defaults to false
mergeReruns.set(true) // defaults to false
}
}
}

plugins.withType<TestLoggerPlugin> {
configure<TestLoggerExtension> {
theme = ThemeType.MOCHA
showExceptions = true
showStackTraces = true
showFullStackTraces = false
showCauses = true
slowThreshold = 20000
showSummary = true
showSimpleNames = false
showPassed = true
showSkipped = true
showFailed = true
showStandardStreams = true
showPassedStandardStreams = false
showSkippedStandardStreams = false
showFailedStandardStreams = true
logLevel = LogLevel.LIFECYCLE
}
}

reporting.baseDir = file("$buildDir/reports")
project.setProperty("testResultsDirName", "$buildDir/test-results")

tasks.register("showDirs") {
doLast {
logger.quiet(rootDir.toPath().relativize((project.properties["reportsDir"] as File).toPath()).toString())
logger.quiet(rootDir.toPath().relativize((project.properties["testResultsDir"] as File).toPath()).toString())
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
kotlin.code.style=official

20 changes: 0 additions & 20 deletions src/main/kotlin/nodecore/api/FaucetApi.kt

This file was deleted.

157 changes: 0 additions & 157 deletions src/main/kotlin/nodecore/api/NodeCoreApi.kt

This file was deleted.

Loading