Skip to content

Commit

Permalink
Basic initial tests
Browse files Browse the repository at this point in the history
  • Loading branch information
viv committed Jan 3, 2025
0 parents commit 7f17c71
Show file tree
Hide file tree
Showing 14 changed files with 1,139 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Integration Tests

on:
workflow_dispatch: # Allows manual triggering
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
integration-tests:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write # Required for publishing test results

steps:
- name: Checkout Integration Tests
uses: actions/checkout@v4
with:
repository: surevine/openfire-integration-tests
path: integration-tests

- name: Initialize Submodules
working-directory: integration-tests
run: |
git submodule update --init
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

- name: Run Integration Tests
working-directory: integration-tests
run: ./mvnw -B verify

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always() # Run even if tests fail
with:
junit_files: "integration-tests/target/surefire-reports/*.xml,integration-tests/target/failsafe-reports/*.xml"
check_name: "Integration Test Results"
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties

# IDE - IntelliJ IDEA
.idea/
*.iml
*.iws
*.ipr
out/

# IDE - Eclipse
.settings/
.classpath
.project
.factorypath
bin/

# IDE - VSCode
.vscode/

# Mac OS
.DS_Store

# Docker data directory created during tests
openfire-docker-compose/federation/_data/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "openfire-docker-compose"]
path = openfire-docker-compose
url = https://github.com/surevine/openfire-docker-compose.git
19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Openfire Integration Tests

Integration tests for Openfire, focusing on federation scenarios.

## Prerequisites

- Java 17
- Docker and Docker Compose

## Setup

1. Clone this repository:
```bash
git clone https://github.com/surevine/openfire-integration-tests.git
cd openfire-integration-tests
```

2. Initialize and update the submodule:
```bash
git submodule update --init
```

## Running Tests

The project uses Maven Wrapper, so no local Maven installation is required.

Run all integration tests:
```bash
./mvnw verify
```

Run a specific test:
```bash
./mvnw verify -Dit.test=ConnectAndAuthenticateIT
```

## Test Environment

The tests use the Openfire Docker Compose environment from the `openfire-docker-compose` repository (included as a submodule).

The environment provides:
- Two Openfire instances:
- xmpp1 (ports: 5221, 7071, 9091)
- xmpp2 (ports: 5222, 7072, 9092)
- PostgreSQL databases for each instance
- Pre-configured users:
- xmpp1: user1/password, user2/password
- xmpp2: user3/password, user4/password
- Network configuration for federation

## Development

### Keeping Up to Date

1. Pull latest changes from both repositories:
```bash
git pull
git submodule update --remote
```

2. If switching branches or updating submodule reference:
```bash
git submodule update --init
```
Loading

0 comments on commit 7f17c71

Please sign in to comment.