SPB Git

Repository Public

test-next.sh 2.9 KB 70 lines shellscript

1#!/usr/bin/env bash2# =============================================================================3#                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project          : KA Maps Engine8# File             : sdk/web/scripts/test-next.sh9# Module           : sdk10# Repository       : https://git.spboucher.ai/ka-maps-engine11# Created          : 2026-12-0112# Last Modified    : 2026-12-0113#14# Author           : Simon-Pierre Boucher15# Position         : Professor of Finance16# Institution      : Université du Québec en Outaouais (UQO)17# Organization     : SP Boucher18# Website          : https://spboucher.ai19# Git              : https://git.spboucher.ai20#21# Preferred Contact: support@spboucher.ai22# Technical Contact: dev@spboucher.ai23# Security/Admin   : admin@spboucher.ai24#25# Copyright (c) 202626# Simon-Pierre Boucher27# All rights reserved where applicable. This file is governed by the28# applicable project license, copyright notices and relevant law.29# Existing third-party rights and notices remain unaffected.30#31# License          : None specified (no license file in this repository)32#33# Do not embed credentials, private keys, access tokens,34# certificates or confidential personal information.35#36# =============================================================================37# END OF SP BOUCHER SOURCE HEADER38# =============================================================================3940# Essai d'intégration réel dans Next.js 16 (app router) : installe l'archive ka-maps-<version>.tgz dans41# tests/next-app, construit le site (production), le sert sur le port 5320 sous CSP à nonce, puis42# vérifie dans Chromium, Firefox et WebKit sans fenêtre que la carte se charge.43#44#   scripts/build.sh --pack && scripts/test-next.sh45set -euo pipefail46HERE="$(cd "$(dirname "$0")/.." && pwd)"47cd "$HERE"48VERSION="$(node -p "require('./package.json').version")"49TGZ="$HERE/ka-maps-$VERSION.tgz"50[ -f "$TGZ" ] || { echo "archive absente : lancer scripts/build.sh --pack" >&2; exit 1; }5152cd tests/next-app53rm -rf node_modules/@ka .next public/ka-maps54npm install --no-audit --no-fund --no-package-lock "$TGZ" >/dev/null55npm install --no-audit --no-fund --no-package-lock >/dev/null56echo "== next build ($(node -p "require('next/package.json').version"))"57npx next build5859npx next start -H 127.0.0.1 -p 5320 > /tmp/ka-maps-next.log 2>&1 &60PID=$!61# Arrêt par PID (jamais par nom) : le lanceur npx et le serveur qui écoute sur le port.62stop() { kill $PID 2>/dev/null || true; for p in $(lsof -nP -tiTCP:5320 -sTCP:LISTEN 2>/dev/null); do kill "$p" 2>/dev/null || true; done; }63trap stop EXIT64for i in $(seq 1 60); do65  curl -sf -o /dev/null http://127.0.0.1:5320/ && break66  sleep 0.567done68cd "$HERE"69KA_FIXTURE_URL=http://127.0.0.1:5320/ KA_FIXTURE_GLOBAL=__kaNext KA_FIXTURE_BRAND=louka KA_FIXTURE_SERVER=1 node scripts/check-fixture.mjs70
Files main
Menu

Theme