Skip to content

Commit

Permalink
Functional testing framework for PBS (#1536)
Browse files Browse the repository at this point in the history
* PBS functional testing framework

* update

* update

* update

* update

* update

Co-authored-by: mtuchkova <mtuchkova@magnite.com>
  • Loading branch information
Net-burst and mtuchkova authored Oct 20, 2021
1 parent 532b803 commit cace976
Show file tree
Hide file tree
Showing 197 changed files with 6,151 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B package --file extra/pom.xml
run: mvn -B verify --file extra/pom.xml
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
target/

.DS_Store

.allure/
2 changes: 2 additions & 0 deletions .maven-dockerinclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/*.jar
src/main/docker/*
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM openjdk:11-jdk-slim

WORKDIR /app/prebid-server

VOLUME /app/prebid-server/conf
VOLUME /app/prebid-server/data

COPY src/main/docker/run.sh ./
COPY src/main/docker/application.yaml ./
COPY target/prebid-server.jar ./

EXPOSE 8080
EXPOSE 8060

ENTRYPOINT [ "/app/prebid-server/run.sh" ]
143 changes: 142 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<jetty.version>9.4.43.v20210629</jetty.version>
<restassured.version>3.0.6</restassured.version>
<h2.version>1.4.196</h2.version>
<spock.version>1.3-groovy-2.5</spock.version>
<testcontainers.version>1.15.3</testcontainers.version>
<mockserver-client.version>5.11.2</mockserver-client.version>
<allure.version>2.14.0</allure.version>
<aspectj.version>1.9.7</aspectj.version>

<!-- plugin versions -->
<checkstyle-plugin.version>3.1.0</checkstyle-plugin.version>
Expand All @@ -63,7 +68,11 @@
<jacoco-plugin.version>0.8.2</jacoco-plugin.version>
<git-commmit-plugin.version>2.2.4</git-commmit-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.22.1</maven-surefire-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>${maven-surefire-plugin.version}</maven-failsafe-plugin.version>
<docker-maven-plugin.version>0.36.0</docker-maven-plugin.version>
<gmavenplus-plugin.version>1.12.1</gmavenplus-plugin.version>
<allure-maven.version>2.10.0</allure-maven.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -195,6 +204,18 @@
<artifactId>jackson-module-afterburner</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator</artifactId>
Expand Down Expand Up @@ -400,6 +421,17 @@
<version>${restassured.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>${spock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<scope>test</scope>
</dependency>
<!-- for Mockito to be able to mock Vert.x-specific classes -->
<dependency>
<groupId>io.vertx</groupId>
Expand All @@ -413,6 +445,41 @@
<version>${h2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>spock</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mockserver</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-client-java</artifactId>
<version>${mockserver-client.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-spock</artifactId>
<version>${allure.version}</version>
</dependency>
</dependencies>

<build>
Expand All @@ -429,6 +496,11 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand All @@ -451,6 +523,11 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>${gmavenplus-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>

Expand Down Expand Up @@ -576,8 +653,72 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
<executions>
<execution>
<id>build-containers</id>
<phase>pre-integration-test</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compileTests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<systemPropertyVariables>
<allure.results.directory>target/allure-results</allure.results.directory>
<mockserver.version>${mockserver-client.version}</mockserver.version>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<includes>
<include>**/*Spec.java</include>
</includes>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>${allure-maven.version}</version>
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
Expand Down
4 changes: 4 additions & 0 deletions src/main/docker/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gdpr:
vendorlist:
v2:
cache-dir: /app/prebid-server/data/vendorlist-v2
8 changes: 8 additions & 0 deletions src/main/docker/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

exec java \
-Dvertx.cacheDirBase=/app/prebid-server/data/.vertx \
-Dspring.config.additional-location=/app/prebid-server/,/app/prebid-server/conf/ \
${JAVA_OPTS} \
-jar \
/app/prebid-server/prebid-server.jar
41 changes: 41 additions & 0 deletions src/test/groovy/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[{*.gant, *.gradle, *.groovy, *.gson, *.gy}]
ij_groovy_align_multiline_chained_methods = true
ij_groovy_array_initializer_wrap = normal
ij_groovy_binary_operation_wrap = normal
ij_groovy_blank_lines_after_class_header = 1
ij_groovy_blank_lines_after_imports = 1
ij_groovy_blank_lines_after_package = 1
ij_groovy_blank_lines_around_class = 1
ij_groovy_blank_lines_around_field = 0
ij_groovy_blank_lines_around_field_in_interface = 0
ij_groovy_blank_lines_around_method = 1
ij_groovy_blank_lines_around_method_in_interface = 1
ij_groovy_blank_lines_before_imports = 1
ij_groovy_blank_lines_before_method_body = 0
ij_groovy_blank_lines_before_package = 0
ij_groovy_class_count_to_use_import_on_demand = 999
ij_groovy_do_while_brace_force = always
ij_groovy_extends_list_wrap = normal
ij_groovy_for_brace_force = always
ij_groovy_for_statement_wrap = normal
ij_groovy_if_brace_force = always
ij_groovy_imports_layout = *, |, java.**, |, $*
ij_groovy_insert_inner_class_imports = true
ij_groovy_keep_blank_lines_before_right_brace = 2
ij_groovy_keep_blank_lines_in_code = 1
ij_groovy_keep_blank_lines_in_declarations = 2
ij_groovy_keep_control_statement_in_one_line = false
ij_groovy_keep_line_breaks = true
ij_groovy_keep_multiple_expressions_in_one_line = false
ij_groovy_keep_simple_blocks_in_one_line = false
ij_groovy_keep_simple_classes_in_one_line = true
ij_groovy_keep_simple_lambdas_in_one_line = true
ij_groovy_keep_simple_methods_in_one_line = true
ij_groovy_layout_static_imports_separately = true
ij_groovy_line_comment_at_first_column = true
ij_groovy_method_parameters_wrap = on_every_item
ij_groovy_names_count_to_use_import_on_demand = 999
ij_groovy_ternary_operation_wrap = normal
ij_groovy_throws_keyword_wrap = normal
ij_groovy_use_flying_geese_braces = true
ij_groovy_while_brace_force = always
Loading

0 comments on commit cace976

Please sign in to comment.