Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
536aaeb
Merge branch 'master' into develop
runemalm Feb 17, 2025
6de9642
Fix target in makefile.
runemalm Feb 17, 2025
89c8d95
Update README.
runemalm Feb 17, 2025
f93eb24
Update docs.
runemalm Feb 17, 2025
1c889df
Fix docs.
runemalm Feb 17, 2025
092b0c9
Fix docs.
runemalm Feb 17, 2025
0cb5437
Fix docs.
runemalm Feb 17, 2025
4bb7407
Fix docs.
runemalm Feb 17, 2025
18a49b2
Update README.
runemalm Feb 17, 2025
fcd7005
Add missing 'Add Web API Adapter' step to user-guide.
runemalm Feb 18, 2025
3559ab8
Add tests for domain publisher.
runemalm Feb 19, 2025
8079529
Add unit tests for integration publisher.
runemalm Feb 19, 2025
182b3b6
Add unit tests for InMemoryMessagingProvider.
runemalm Feb 19, 2025
a604474
Fix competing consumer behaviour in InMemoryMessagingProviderTests af…
runemalm Feb 19, 2025
455eaaf
Move test class.
runemalm Feb 19, 2025
adb8634
Add azure target to sample project makefile.
runemalm Feb 19, 2025
9bb633f
Refactor azure service bus messaging provider to improve performance …
runemalm Feb 19, 2025
53ab1cf
Add tests for AzureServiceBusMessagingProvider.
runemalm Feb 19, 2025
6987eca
Dispose azure messaging provider resources properly on shutdown.
runemalm Feb 19, 2025
27efee6
Refactor kafka messaging provider to improve performance, adherance t…
runemalm Feb 19, 2025
0927dfc
Add KafkaMessagingProvider tests.
runemalm Feb 19, 2025
aaf20d0
Update kafka targets in makefile of sample project.
runemalm Feb 19, 2025
f0fc895
Add new kafka setting to appsettings.json of sample project.
runemalm Feb 19, 2025
f66e5ea
Add new AutoCreateTopics to config in docs.
runemalm Feb 19, 2025
89a1125
Refactor rabbitmq provider a bit.
runemalm Feb 20, 2025
72b47ff
Add rabbitmq provider tests.
runemalm Feb 20, 2025
7a5c9b6
Make minor changes.
runemalm Feb 20, 2025
d601bf9
Add validation to azure messaging provider.
runemalm Feb 20, 2025
2fdd898
Add test for azure provider constructor.
runemalm Feb 20, 2025
e9740a5
Add validation to kafka messaging provider.
runemalm Feb 20, 2025
634cc1b
Add unit- and integration test base classes.
runemalm Feb 20, 2025
b965ec4
Add tests workflow.
runemalm Feb 20, 2025
5f7a5b5
Add act targets to makefile.
runemalm Feb 20, 2025
32aee04
Update workflow.
runemalm Feb 20, 2025
343d6af
Fix tests step.
runemalm Feb 20, 2025
ae9aa18
Add test targets to makefile.
runemalm Feb 20, 2025
502d8b5
Create dedicated tests project.
runemalm Feb 20, 2025
c3d183c
Filter tests by 'Trait'.
runemalm Feb 20, 2025
e75c922
Publish test report.
runemalm Feb 20, 2025
ad62e56
Remove .NET 9 from matrix.
runemalm Feb 20, 2025
24a7bad
Update test reports path.
runemalm Feb 20, 2025
127d70f
Fix working directory in integration tests.
runemalm Feb 20, 2025
92481f3
Add tests badge to README.
runemalm Feb 20, 2025
ec46e8a
Upload unit tests badge to shields.io.
runemalm Feb 20, 2025
02e0567
Upload badge to gh-pages.
runemalm Feb 20, 2025
3b3b555
Trigger build.
runemalm Feb 20, 2025
997e681
Checkout gh-pages in workflow.
runemalm Feb 20, 2025
37f1ef8
Remove badge generation from workflow.
runemalm Feb 20, 2025
a59d82f
Add integration tests for azure provider.
runemalm Feb 21, 2025
b644b4f
Remove azure unit tests that we are replacing with integration tests.
runemalm Feb 21, 2025
c07d6ad
Assert topic wasn't created in test.
runemalm Feb 21, 2025
57120b8
Add RabbitMQ provider integration tests.
runemalm Feb 21, 2025
745f4a2
Add a couple of integration tests for rabbit mq provider.
runemalm Feb 21, 2025
dfdb5da
Add more rabbitmq provider integration tests.
runemalm Feb 23, 2025
50d70bc
Add more azure targets to makefile.
runemalm Feb 23, 2025
8622eda
Add more azure messaging provider integration tests.
runemalm Feb 23, 2025
ebcd11b
Add rabbit targets to makefile, for local integration testing.
runemalm Feb 23, 2025
55d3a8d
Add kafka targets to makefile.
runemalm Feb 24, 2025
0445adb
Add custom integration tests xunit logger.
runemalm Feb 24, 2025
6f50ff7
Add kafka provider integration tests.
runemalm Feb 24, 2025
6382e10
Debug tests in github actions.
runemalm Feb 25, 2025
f83657e
Debug tests in github actions.
runemalm Feb 25, 2025
3eaddc1
Debug tests in github actions.
runemalm Feb 25, 2025
2aaa114
Debug tests in github actions.
runemalm Feb 25, 2025
4ba1cbb
Debug tests in github actions.
runemalm Feb 25, 2025
7aeaed8
Debug tests in github actions.
runemalm Feb 25, 2025
19a9a9c
Debug tests in github actions.
runemalm Feb 25, 2025
83e6484
Debug tests in github actions.
runemalm Feb 25, 2025
d8d09b1
Debug tests in github actions.
runemalm Feb 28, 2025
79f506b
Debug tests in github actions.
runemalm Feb 28, 2025
24677e5
Add postgres repository integration tests.
runemalm Feb 28, 2025
9c55a75
Debug tests in github actions.
runemalm Feb 28, 2025
98028f0
Debug tests in github actions.
runemalm Feb 28, 2025
3b3ea7d
Add in-memory repository integration tests.
runemalm Feb 28, 2025
3c562bb
Debug tests in github actions.
runemalm Feb 28, 2025
9449f13
Make kafka integration test wait for group stabilization before publi…
runemalm Feb 28, 2025
392a37e
Wait for group stabilization in other kafka tests as well.
runemalm Feb 28, 2025
b713b54
Add integration tests for postgres & sqlite efcore repositories.
runemalm Mar 4, 2025
ea843f1
Rename test classes.
runemalm Mar 4, 2025
5664760
Add consumer offset and re-delivery support to in-memory messaging pr…
runemalm Mar 4, 2025
ed55ee4
Add integration tests for in-memory messaging provider.
runemalm Mar 4, 2025
bcb49c4
Fix issue in kafka messaging provider test.
runemalm Mar 4, 2025
790e544
Refactor in-memory messaging provider unit tests.
runemalm Mar 4, 2025
bf4de01
Fix issue in in-memory test.
runemalm Mar 4, 2025
913caef
Refactor azure service bus tests a bit.
runemalm Mar 4, 2025
da1964d
Refactor a bit.
runemalm Mar 4, 2025
8c28509
Refactor rabbitmq messaging provider integration tests.
runemalm Mar 4, 2025
94c3702
Refactor tests namespaces.
runemalm Mar 4, 2025
90ea7c7
Increase timeout in azure test.
runemalm Mar 4, 2025
be2fb3f
Fix issue with kafka messaging provider not distributing messages amo…
runemalm Mar 6, 2025
b2387ff
Rename test.
runemalm Mar 6, 2025
6baa4f8
Change kafka default partition count.
runemalm Mar 6, 2025
a6eb9c2
Refactor tests.
runemalm Mar 7, 2025
7aed973
Increase delay to attempt to fix failing test in github workflow.
runemalm Mar 7, 2025
a054631
Rename rabbit consumer class.
runemalm Mar 7, 2025
479191f
Attempt to fix test in pipeline.
runemalm Mar 7, 2025
8e6b69f
Auto-commit initial offset on partitions with no messages on unsubscr…
runemalm Mar 7, 2025
cb26cd2
Add auto-create-topics support to RabbitMQ provider as well.
runemalm Mar 8, 2025
213f250
Refactor rabbit provider by breaking out helper method for reuse.
runemalm Mar 8, 2025
bfb96ef
Refactor code and tests for messaging providers.
runemalm Mar 8, 2025
c7a93ee
Refactor messaging provider tests a bit.
runemalm Mar 8, 2025
a80a69b
Add a couple of test methods for publishing with auto-create true/fal…
runemalm Mar 8, 2025
126a26d
Cache topic checks for ten minutes in messaging providers.
runemalm Mar 8, 2025
25306f3
Update version to beta.2.
runemalm Mar 8, 2025
1df95b3
Cleanup a bit.
runemalm Mar 8, 2025
18e7aec
Remove tests that shouldn't be in sample and/or template projects.
runemalm Mar 8, 2025
96b58e7
Fix appsettings key in sample and template projects.
runemalm Mar 8, 2025
2d9050a
Use beta.2 in template project.
runemalm Mar 8, 2025
28f1372
Add release notes.
runemalm Mar 13, 2025
1cc4784
Bump version in docs conf.py
runemalm Mar 13, 2025
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
207 changes: 207 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
name: Tests

on:
push:
branches:
- develop

jobs:
unit-tests:
name: Unit Tests (.NET ${{ matrix.dotnet-version }})
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [8.0.x]

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Restore Dependencies
working-directory: src/OpenDDD.Tests
run: dotnet restore

- name: Build Project
working-directory: src/OpenDDD.Tests
run: dotnet build --no-restore --configuration Release /p:TreatWarningsAsErrors=false

- name: Run Unit Tests
working-directory: src/OpenDDD.Tests
run: dotnet test --no-build --configuration Release --filter "Category=Unit" --logger "trx;LogFileName=TestResults.trx" --results-directory TestResults

- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: UnitTestResults
path: src/OpenDDD.Tests/TestResults/TestResults.trx

- name: Publish Unit Test Report
if: always()
uses: dorny/test-reporter@v1
with:
name: Unit Tests Report
path: src/OpenDDD.Tests/TestResults/TestResults.trx
reporter: dotnet-trx

integration-tests:
name: Integration Tests (.NET ${{ matrix.dotnet-version }})
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [8.0.x]

services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
env:
ZOOKEEPER_CLIENT_PORT: 2181
ports:
- 2181:2181

kafka:
image: confluentinc/cp-kafka:latest
env:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
ports:
- 9092:9092
options: --network-alias kafka

rabbitmq:
image: rabbitmq:3-management
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672:5672
- 15672:15672
options: --health-cmd "rabbitmq-diagnostics check_port_connectivity" --health-interval 10s --health-timeout 5s --health-retries 5

postgres:
image: postgres:latest
env:
POSTGRES_DB: testdb
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpassword
ports:
- 5432:5432
options: --health-cmd "pg_isready -U testuser" --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Restore Dependencies
working-directory: src/OpenDDD.Tests
run: dotnet restore

- name: Build Project
working-directory: src/OpenDDD.Tests
run: dotnet build --no-restore --configuration Release

- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Create Azure Service Bus namespace for Testing
run: |
NAMESPACE_NAME="test-servicebus-${{ github.run_id }}-${{ github.run_attempt }}"
echo "NAMESPACE_NAME=${NAMESPACE_NAME}" >> $GITHUB_ENV
az servicebus namespace create \
--resource-group opendddnet \
--name $NAMESPACE_NAME \
--location northeurope
CONNECTION_STRING=$(az servicebus namespace authorization-rule keys list \
--resource-group opendddnet \
--namespace-name $NAMESPACE_NAME \
--name RootManageSharedAccessKey \
--query primaryConnectionString \
-o tsv)
echo "AZURE_SERVICE_BUS_CONNECTION_STRING=${CONNECTION_STRING}" >> $GITHUB_ENV

- name: Wait for RabbitMQ to be Ready
run: |
for i in {1..10}; do
if curl -s -f http://localhost:15672 || nc -z localhost 5672; then
echo "RabbitMQ is up!"
exit 0
fi
echo "Waiting for RabbitMQ..."
sleep 5
done
echo "RabbitMQ did not start in time!" && exit 1

- name: Wait for Kafka to be Ready
run: |
for i in {1..10}; do
if nc -z localhost 9092; then
echo "Kafka is up!"
exit 0
fi
echo "Waiting for Kafka..."
sleep 5
done
echo "Kafka did not start in time!" && exit 1

- name: Wait for PostgreSQL to be Ready
run: |
for i in {1..10}; do
if PGPASSWORD=testpassword psql -h localhost -U testuser -d testdb -c "SELECT 1" &> /dev/null; then
echo "PostgreSQL is up!"
exit 0
fi
echo "Waiting for PostgreSQL..."
sleep 5
done
echo "PostgreSQL did not start in time!" && exit 1

- name: Run Integration Tests
working-directory: src/OpenDDD.Tests
env:
KAFKA_BOOTSTRAP_SERVERS: localhost:9092
RABBITMQ_HOST: localhost
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: guest
RABBITMQ_PASSWORD: guest
AZURE_SERVICE_BUS_CONNECTION_STRING: ${{ env.AZURE_SERVICE_BUS_CONNECTION_STRING }}
POSTGRES_TEST_CONNECTION_STRING: "Host=localhost;Port=5432;Database=testdb;Username=testuser;Password=testpassword"
run: dotnet test --no-build --configuration Release --filter "Category=Integration" --logger "trx;LogFileName=TestResults.trx" --results-directory TestResults

- name: Delete Azure Service Bus namespace After Tests
if: always()
run: |
if [[ -n "${NAMESPACE_NAME}" ]]; then
echo "Deleting namespace: $NAMESPACE_NAME"
az servicebus namespace delete --resource-group opendddnet --name $NAMESPACE_NAME
else
echo "No namespace found, skipping deletion."
fi

- name: Upload Integration Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: IntegrationTestResults
path: src/OpenDDD.Tests/TestResults/TestResults.trx

- name: Publish Integration Test Report
if: always()
uses: dorny/test-reporter@v1
with:
name: Integration Tests Report
path: src/OpenDDD.Tests/TestResults/TestResults.trx
reporter: dotnet-trx
Loading