Update workflow to dump Docker logs on failure and improve PostgreSQL container configuration
- Add Docker logs capturing step in GitHub Actions workflow for better debugging. - Update PostgreSQL test container to use `postgres:16-alpine` with enhanced configuration options. - Set database connection `Max Pool Size` to 20 in component tests.
This commit is contained in:
parent
baf2495fd5
commit
56089c95f1
11
.github/workflows/packages.yml
vendored
11
.github/workflows/packages.yml
vendored
|
|
@ -70,6 +70,17 @@ jobs:
|
|||
dotnet test "$project" --configuration Release --no-build --logger "GitHubActions;report-warnings=false" /p:CollectCoverage=true
|
||||
done
|
||||
|
||||
- name: Dump docker logs on failure
|
||||
if: failure()
|
||||
run: |
|
||||
echo "=== Docker containers ==="
|
||||
docker ps -a || true
|
||||
echo "=== Docker logs ==="
|
||||
for container in $(docker ps -aq); do
|
||||
echo "--- Logs for container $container ---"
|
||||
docker logs "$container" 2>&1 | tail -100 || true
|
||||
done
|
||||
|
||||
- name: Install ReportGenerator
|
||||
run: dotnet tool install -g dotnet-reportgenerator-globaltool
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,17 @@ namespace Elsa.Workflows.ComponentTests.Fixtures;
|
|||
public class Infrastructure : IAsyncLifetime
|
||||
{
|
||||
public readonly PostgreSqlContainer DbContainer = new PostgreSqlBuilder()
|
||||
.WithImage("postgres:latest")
|
||||
.WithImage("postgres:16-alpine")
|
||||
.WithDatabase("elsa")
|
||||
.WithUsername("postgres")
|
||||
.WithPassword("postgres")
|
||||
.WithCommand(
|
||||
"postgres",
|
||||
"-c", "max_connections=25",
|
||||
"-c", "shared_buffers=128MB",
|
||||
"-c", "work_mem=4MB",
|
||||
"-c", "effective_cache_size=256MB"
|
||||
)
|
||||
.Build();
|
||||
|
||||
public readonly RabbitMqContainer RabbitMqContainer = new RabbitMqBuilder()
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class WorkflowServer(Infrastructure infrastructure, string url) : WebAppl
|
|||
|
||||
protected override void ConfigureWebHost(IWebHostBuilder builder)
|
||||
{
|
||||
var dbConnectionString = infrastructure.DbContainer.GetConnectionString();
|
||||
var dbConnectionString = infrastructure.DbContainer.GetConnectionString() + ";Max Pool Size=20;";
|
||||
var rabbitMqConnectionString = infrastructure.RabbitMqContainer.GetConnectionString();
|
||||
|
||||
builder.UseUrls(url);
|
||||
|
|
|
|||
Loading…
Reference in a new issue