Skip to content

Commit

Permalink
Add acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi committed Apr 18, 2024
1 parent 43b89e7 commit 88a6182
Show file tree
Hide file tree
Showing 27 changed files with 15,478 additions and 7 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,29 @@ jobs:
push: true
tags: jack20191124/athena-example-books:latest

acceptance-tests:
name: Run example acceptance tests
needs: examples-basic-app-docker-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: QubitPi/hashicorp-aws/.github/actions/jdk-setup@master
- name: Package up WAR
run: mvn clean package
- name: Start Book example application Docker Compose
run: docker compose up &
working-directory: athena-examples/athena-example-books
- name: Wait until Docker Compose is up
run: |
npm install -g wait-on
wait-on http://localhost:8080
- name: Run acceptance tests
run: mvn clean verify -P acceptance-test

documentation:
name: Test Documentation Build & Deploy Documentation to GitHub Pages
needs: tests
needs: acceptance-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -106,7 +126,7 @@ jobs:

release:
name: Release Athena to Maven Central
needs: tests
needs: acceptance-tests
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class ResourceConfig extends org.glassfish.jersey.server.ResourceConfig {
public ResourceConfig() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
final Class<? extends BinderFactory> binderClass = Class.forName(getBindingFactory())
.asSubclass(BinderFactory.class);
LOG.info("Application resource binder is '{}'", binderClass.getCanonicalName());
final BinderFactory binderFactory = binderClass.newInstance();
final Binder binder = binderFactory.buildBinder();

Expand Down
8 changes: 8 additions & 0 deletions athena-examples/athena-example-acceptance-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.idea/
*.iml
.DS_Store
target/
derby.log

# Local config file should be ignored
userConfig.properties
24 changes: 24 additions & 0 deletions athena-examples/athena-example-acceptance-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Athena Acceptance Test Framework
================================

![Cucumber Badge][Cucumber Badge]

Athena acceptance test framework is a slightly modified BDD, which
[eliminates the QA](https://spectrum.ieee.org/yahoos-engineers-move-to-coding-without-a-net)

The acceptances tests runs against the
[book example application](https://github.com/QubitPi/athena/tree/master/athena-examples/athena-example-books), which
can be brought up using its dedicated Docker Compose:

```console
cd athena/athena-examples/athena-example-books/
docker compose up
```

Then navigate to the project root and run all acceptance tests with

```console
mvn clean verify
```

[Cucumber Badge]: https://img.shields.io/badge/Cucumber-23D96C?style=for-the-badge&logo=cucumber&logoColor=white
122 changes: 122 additions & 0 deletions athena-examples/athena-example-acceptance-tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.github.qubitpi.athena</groupId>
<artifactId>athena-examples</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>athena-example-acceptance-tests</artifactId>

<packaging>jar</packaging>
<name>Athena: Acceptance Test for Example Applications</name>
<description>A modified BDD module with the concept of QA eliminated</description>

<developers>
<developer>
<name>Jiaqi Liu</name>
<url>https://github.com/QubitPi</url>
</developer>
</developers>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-bom</artifactId>
<version>7.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>1.19.7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- Cucumber -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.1</version>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 88a6182

Please sign in to comment.