test(pangolin): niet afhankelijk van waar de tests draaien
All checks were successful
Deploy server-up (dev) / deploy (push) Successful in 4m39s
All checks were successful
Deploy server-up (dev) / deploy (push) Successful in 4m39s
Run 243 (570958c) faalde op twee tests in tests/test_pangolin_per_app.py:
- test_interface roept node aan; de CI-container heeft geen node. Nu
overgeslagen zonder node, zoals de andere JS-tests.
- test_installeren_met_publiceren: op de runner draaien de tests zelf in
een container, dus vraagt het doeladres networks.host_ip() op via
Docker, en die is er niet. Het product doet dan het juiste (geen
containeradres als doel); de test hing van de omgeving af. Een
autouse-fixture zet _in_container op False; de test voor het
containergeval zet het zelf op True.
Tests: tests/test_pangolin_per_app.py 19 groen, ook met een plugin die
de runner nabootst (in een container, zonder docker en node: 175 tests
over de nieuwe bestanden groen). Volledige suite 8104 geslaagd (rc=0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WPhDUEiVvmH9F4uUkPGKsT
This commit is contained in:
parent
570958c029
commit
a84528b7a5
1 changed files with 12 additions and 0 deletions
|
|
@ -37,6 +37,13 @@ def pg(env, monkeypatch):
|
||||||
return staat
|
return staat
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def _niet_in_een_container(monkeypatch, env):
|
||||||
|
"""De runner draait de tests zelf in een container zonder Docker."""
|
||||||
|
import app as app_module
|
||||||
|
monkeypatch.setattr(app_module.paden, "_in_container", lambda: False)
|
||||||
|
|
||||||
|
|
||||||
def _stack(env, naam="web", diensten=("web",)):
|
def _stack(env, naam="web", diensten=("web",)):
|
||||||
d = env["lib"] / naam
|
d = env["lib"] / naam
|
||||||
d.mkdir(parents=True, exist_ok=True)
|
d.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
@ -201,6 +208,10 @@ def test_installeren_met_publiceren(client, env, pg, monkeypatch):
|
||||||
monkeypatch.setattr(app_module.mapvoorbereiding, "klaarzetten", lambda *a, **k: [])
|
monkeypatch.setattr(app_module.mapvoorbereiding, "klaarzetten", lambda *a, **k: [])
|
||||||
monkeypatch.setattr(app_module, "_nazorg", lambda *a, **k: True)
|
monkeypatch.setattr(app_module, "_nazorg", lambda *a, **k: True)
|
||||||
monkeypatch.setattr(app_module, "_sjabloon_opslagproblemen", lambda *a, **k: [])
|
monkeypatch.setattr(app_module, "_sjabloon_opslagproblemen", lambda *a, **k: [])
|
||||||
|
# Niet afhankelijk van waar de tests draaien: in CI is dat zelf een
|
||||||
|
# container zonder Docker, en dan is er geen hostadres op te vragen.
|
||||||
|
monkeypatch.setattr(app_module.paden, "_in_container", lambda: False)
|
||||||
|
monkeypatch.setattr(app_module, "_eigen_host_ip", lambda: "192.168.1.60")
|
||||||
r = _post(client, csrf, "/api/store/install", {
|
r = _post(client, csrf, "/api/store/install", {
|
||||||
"stack": "proef", "repo_id": "server-up", "instance": "proef",
|
"stack": "proef", "repo_id": "server-up", "instance": "proef",
|
||||||
"values": {"service_name": "proef", "port": 8199},
|
"values": {"service_name": "proef", "port": 8199},
|
||||||
|
|
@ -220,6 +231,7 @@ def test_installeren_met_publiceren_zonder_pangolin_geweigerd(client, env):
|
||||||
|
|
||||||
# ── Interface ────────────────────────────────────────────────────────────────
|
# ── Interface ────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not __import__("shutil").which("node"), reason="node ontbreekt")
|
||||||
def test_interface():
|
def test_interface():
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
html = (Path(__file__).resolve().parent.parent / "server-up" / "templates" / "index.html").read_text(encoding="utf-8")
|
html = (Path(__file__).resolve().parent.parent / "server-up" / "templates" / "index.html").read_text(encoding="utf-8")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue