fix(ci): stabilize end-to-end pipeline (#88)
Use the runner-mounted Docker socket instead of a conflicting DinD daemon, remove host-path binds from the real E2E stack, and assert Material combobox state instead of overlay detachment.
This commit is contained in:
1 parent
efb4c94065
commit
d4f8f28faf
5 files changed
+39
-18
No files matched your search
@@ -44,13 +44,7 @@ frontend-e2e:
|
||||
real-backend-e2e:
|
||||
stage: test
|
||||
image: docker:27.5.1-cli
|
||||
services:
|
||||
- name: docker:27.5.1-dind
|
||||
alias: docker
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
DOCKER_TLS_CERTDIR: ''
|
||||
DOCKER_DRIVER: overlay2
|
||||
E2E_ARTIFACT_DIR: .e2e-real-artifacts
|
||||
RUNNER_SCRIPT_TIMEOUT: 13m
|
||||
RUNNER_AFTER_SCRIPT_TIMEOUT: 2m
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
FROM ghcr.io/dexidp/dex:v2.41.1
|
||||
|
||||
COPY config.yaml /etc/dex/config.yaml
|
||||
+3
-5
@@ -37,10 +37,10 @@ services:
|
||||
start_period: 10s
|
||||
|
||||
dex:
|
||||
image: ghcr.io/dexidp/dex:v2.41.1
|
||||
build:
|
||||
context: ./compose.e2e.d/dex
|
||||
dockerfile: Dockerfile
|
||||
command: [dex, serve, /etc/dex/config.yaml]
|
||||
volumes:
|
||||
- ./compose.e2e.d/dex/config.yaml:/etc/dex/config.yaml:ro
|
||||
networks:
|
||||
- e2e
|
||||
healthcheck:
|
||||
@@ -139,8 +139,6 @@ services:
|
||||
condition: service_healthy
|
||||
frontend:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- ${E2E_ARTIFACT_DIR:-./.e2e-real-artifacts}:/work/artifacts
|
||||
networks:
|
||||
- e2e
|
||||
|
||||
|
||||
@@ -93,24 +93,30 @@ test('persists an apartment legal profile through creation, revision, and reopen
|
||||
.getByLabel('Identifiant fiscal du logement')
|
||||
.fill(completeLegalProfile.taxIdentifier);
|
||||
await page.getByLabel('Département').fill('20');
|
||||
await page.getByRole('combobox', { name: 'Type de bâtiment' }).press('Enter');
|
||||
const buildingTypeSelect = page.getByRole('combobox', { name: 'Type de bâtiment' });
|
||||
await buildingTypeSelect.press('Enter');
|
||||
const buildingTypeOption = page.getByRole('option', { name: 'Immeuble collectif' });
|
||||
await buildingTypeOption.click();
|
||||
await expect(buildingTypeOption).toBeHidden();
|
||||
await page.getByRole('combobox', { name: 'Période de construction' }).press('Enter');
|
||||
await expect(buildingTypeSelect).toHaveAttribute('aria-expanded', 'false');
|
||||
const constructionPeriodSelect = page.getByRole('combobox', {
|
||||
name: 'Période de construction',
|
||||
});
|
||||
await constructionPeriodSelect.press('Enter');
|
||||
const constructionPeriodOption = page.getByRole('option', { name: 'De 1990 à 2005' });
|
||||
await constructionPeriodOption.click();
|
||||
await expect(constructionPeriodOption).toBeHidden();
|
||||
await expect(constructionPeriodSelect).toHaveAttribute('aria-expanded', 'false');
|
||||
await page
|
||||
.getByLabel("Régime juridique de l'immeuble")
|
||||
.fill(completeLegalProfile.ownershipRegime);
|
||||
await page.getByLabel('Surface habitable').fill(String(completeLegalProfile.habitableSurface));
|
||||
await page.getByRole('combobox', { name: 'Classe énergétique' }).press('Enter');
|
||||
const energyRatingSelect = page.getByRole('combobox', { name: 'Classe énergétique' });
|
||||
await energyRatingSelect.press('Enter');
|
||||
const energyRatingOption = page.getByRole('option', {
|
||||
name: completeLegalProfile.energyRating ?? '',
|
||||
exact: true,
|
||||
});
|
||||
await energyRatingOption.click();
|
||||
await expect(energyRatingOption).toBeHidden();
|
||||
await expect(energyRatingSelect).toHaveAttribute('aria-expanded', 'false');
|
||||
await page
|
||||
.getByLabel('Coût annuel énergétique estimé')
|
||||
.fill(String(completeLegalProfile.estimatedAnnualEnergyCost));
|
||||
|
||||
+21
-1
@@ -15,7 +15,6 @@ artifact_dir="$artifact_root/$project_name"
|
||||
mkdir -p "$artifact_dir"
|
||||
chmod 0777 "$artifact_dir"
|
||||
export COMPOSE_PROJECT_NAME="$project_name"
|
||||
export E2E_ARTIFACT_DIR="$artifact_dir"
|
||||
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo 'Docker daemon is unavailable; real E2E requires the configured Docker socket or DinD service.' >&2
|
||||
@@ -34,6 +33,7 @@ runner_name="$project_name-runner"
|
||||
services='mongodb dex insee backend frontend'
|
||||
status=0
|
||||
service_log_follow_pid=''
|
||||
runner_artifacts_copied=0
|
||||
|
||||
start_service_log_followers() {
|
||||
compose logs --no-color --follow $services &
|
||||
@@ -48,6 +48,23 @@ stop_service_log_followers() {
|
||||
fi
|
||||
}
|
||||
|
||||
copy_runner_artifacts() {
|
||||
if [ "$runner_artifacts_copied" -ne 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
if ! docker inspect "$runner_name" >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
copy_status=0
|
||||
docker cp "$runner_name:/work/artifacts/." "$artifact_dir/" || copy_status=$?
|
||||
if [ "$copy_status" -ne 0 ]; then
|
||||
printf 'Runner artifact copy failed with status %s.\n' "$copy_status" >&2
|
||||
[ "$status" -ne 0 ] || status=$copy_status
|
||||
else
|
||||
runner_artifacts_copied=1
|
||||
fi
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
cleanup_status=$?
|
||||
if [ "$status" -eq 0 ] && [ "$cleanup_status" -ne 0 ]; then
|
||||
@@ -56,6 +73,7 @@ cleanup() {
|
||||
run_status=$status
|
||||
set +e
|
||||
stop_service_log_followers
|
||||
copy_runner_artifacts
|
||||
for service in $services; do
|
||||
compose logs --no-color "$service" >"$artifact_dir/service-$service.log" 2>&1 || true
|
||||
done
|
||||
@@ -122,6 +140,8 @@ compose run --name "$runner_name" --no-deps runner "$@"
|
||||
status=$?
|
||||
set -e
|
||||
|
||||
copy_runner_artifacts
|
||||
|
||||
if [ ! -f "$artifact_dir/preflight.ok" ]; then
|
||||
echo 'Real E2E preflight did not produce preflight.ok.' >&2
|
||||
[ "$status" -ne 0 ] || status=1
|
||||
|
||||
Reference in new issue
Block a user