Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 9 additions & 2 deletions TEST-SCENARIOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,12 @@ dotnet test tests/Core.IntegrationTests --filter "FullyQualifiedName~ChainBusy"

**Lokalde derlenen runtime'a karşı (geliştirme sırasında doğru olan yol).** Henüz release edilmemiş
bir geliştirme image üzerinden test edilemez — image eski kodu taşır.
`tests/Core.IntegrationTests/test.runsettings` içinde `VNEXT_BASE_URL`'i aç:
`tests/Core.IntegrationTests/test.runsettings` içinde `VNEXT_BASE_URL` **set olmalı** — repoda
halihazırda `http://localhost:4201` olarak commit'lidir, yorumdan çıkarılacak bir şey yoktur; sadece
doğrula. Farklı bir port/offset için commit'li dosyayı düzenleme: yanına git-ignore'lu
`test.runsettings.local` koy (csproj ve SDK onu tercih eder; öncelik: gerçek ortam değişkeni >
`test.runsettings.local` > `test.runsettings`). Set değilse SDK image'lı Testcontainers stack'ini kaldırır —
geliştirme testinde istenmeyen şey budur.

```xml
<VNEXT_BASE_URL>http://localhost:4201</VNEXT_BASE_URL>
Expand All @@ -256,7 +261,9 @@ outbox — hepsi `--launch-profile http` ile), migration varsa db-migrator bir k
### Python davranış / yük testleri

Senaryonun `api-tests/<senaryo>/` klasöründe dururlar. Çalışan bir runtime'a ihtiyaç duyarlar;
`--publish` bayrağı bileşenleri publish eder.
`--publish` bayrağı bileşenleri publish eder. Hepsi `--base-url` alır (varsayılan: `VNEXT_BASE_URL`
ortam değişkeni, o da yoksa `http://localhost:4201`) — farklı bir domain/offset'e koşturmak için
`VNEXT_BASE_URL=http://localhost:4211 python3 ...` ya da `--base-url http://localhost:4211`.

```bash
python3 api-tests/script-race-lab/race-load.py --publish --parallel 30 --timeout 240
Expand Down
8 changes: 7 additions & 1 deletion api-tests/chain-busy/chain-busy-accept-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import argparse
import json
import os
import subprocess
import sys
import time
Expand All @@ -37,7 +38,8 @@
import uuid
from pathlib import Path

BASE = "http://localhost:4201/api/v1"
DEFAULT_BASE_URL = os.environ.get("VNEXT_BASE_URL", "http://localhost:4201").rstrip("/")
BASE = DEFAULT_BASE_URL + "/api/v1" # main() icinde --base-url ile ezilir
DOMAIN = "core"
ROOT_WF = "chain-busy-root"
MIDDLE_WF = "chain-busy-middle"
Expand Down Expand Up @@ -198,10 +200,14 @@ def run_iteration(it):


def main():
global BASE
ap = argparse.ArgumentParser()
ap.add_argument("--iterations", type=int, default=5)
ap.add_argument("--publish", action="store_true", help="calistirmadan once flow'lari publish et")
ap.add_argument("--base-url", default=DEFAULT_BASE_URL,
help="orchestrator base URL (varsayilan: VNEXT_BASE_URL ortam degiskeni ya da http://localhost:4201)")
args = ap.parse_args()
BASE = args.base_url.rstrip("/") + "/api/v1"

print("=" * 72)
print("Accept-time SubFlow chain reserve testi — chain-busy A -> B -> C")
Expand Down
8 changes: 7 additions & 1 deletion api-tests/chain-busy/chain-busy-behaviour-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

import argparse
import json
import os
import subprocess
import sys
import time
Expand All @@ -55,7 +56,8 @@
import uuid
from pathlib import Path

BASE = "http://localhost:4201/api/v1"
DEFAULT_BASE_URL = os.environ.get("VNEXT_BASE_URL", "http://localhost:4201").rstrip("/")
BASE = DEFAULT_BASE_URL + "/api/v1" # main() icinde --base-url ile ezilir
DOMAIN = "core"
ROOT_WF = "chain-busy-root"
MIDDLE_WF = "chain-busy-middle"
Expand Down Expand Up @@ -534,6 +536,7 @@ def publish():
# ── main ────────────────────────────────────────────────────────────────────

def main():
global BASE
ap = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument("--iterations", type=int, default=2)
Expand All @@ -545,7 +548,10 @@ def main():
"uzerinden gider; onceki case'lerin olaylari drenaj halindeyken yeni bir "
"kaskad gecikebilir. 0 = bekleme yok.")
ap.add_argument("--list", action="store_true", help="case'leri listele ve cik")
ap.add_argument("--base-url", default=DEFAULT_BASE_URL,
help="orchestrator base URL (varsayilan: VNEXT_BASE_URL ortam degiskeni ya da http://localhost:4201)")
args = ap.parse_args()
BASE = args.base_url.rstrip("/") + "/api/v1"

if args.list:
for name in sorted(CASES):
Expand Down
8 changes: 7 additions & 1 deletion api-tests/data-integrity-lab/integrity-lab-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import argparse
import concurrent.futures as cf
import json
import os
import subprocess
import sys
import threading
Expand All @@ -48,7 +49,8 @@
import uuid
from pathlib import Path

BASE = "http://localhost:4201/api/v1"
DEFAULT_BASE_URL = os.environ.get("VNEXT_BASE_URL", "http://localhost:4201").rstrip("/")
BASE = DEFAULT_BASE_URL + "/api/v1" # main() icinde --base-url ile ezilir
DOMAIN = "core"
WF = "data-integrity-lab"
SCHEMA = "data_integrity_lab"
Expand Down Expand Up @@ -361,12 +363,16 @@ def publish_definitions():


def main():
global BASE
ap = argparse.ArgumentParser()
ap.add_argument("--iterations", type=int, default=6)
ap.add_argument("--threshold", type=int, default=4)
ap.add_argument("--burst", type=int, default=4)
ap.add_argument("--publish", action="store_true", help="once task+flow tanimlarini publish et")
ap.add_argument("--base-url", default=DEFAULT_BASE_URL,
help="orchestrator base URL (varsayilan: VNEXT_BASE_URL ortam degiskeni ya da http://localhost:4201)")
args = ap.parse_args()
BASE = args.base_url.rstrip("/") + "/api/v1"

if args.publish:
print("== Definition publish ==")
Expand Down
3 changes: 2 additions & 1 deletion api-tests/fan-out-documents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ MockLab seed'i `etc/docker/config/seed/fan-out-documents-collection.json` içerm

> **Runtime sürümü.** FanOutTask henüz release edilmedi. Container image'ı **eski kodu taşır**;
> senaryoyu lokalde derlenen runtime'a karşı koşun. Integration testler için
> `tests/Core.IntegrationTests/test.runsettings` içinde `VNEXT_BASE_URL`'i açın.
> `tests/Core.IntegrationTests/test.runsettings` içindeki `VNEXT_BASE_URL` (repoda commit'li) lokal
> orchestrator'ı göstermeli; farklı port için git-ignore'lu `test.runsettings.local` kullanın.

> **`npm run validate` bu senaryoda BAŞARISIZ** — `@burgan-tech/vnext-schema@0.0.52` enum'u
> `"20"`de bittiği için `attributes.type: "21"` reddediliyor. Bileşen doğru; şema paketi release
Expand Down
8 changes: 7 additions & 1 deletion api-tests/l1-cache-lab/l1-cache-behaviour-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import argparse
import json
import os
import subprocess
import sys
import time
Expand All @@ -41,7 +42,8 @@
import uuid
from pathlib import Path

BASE = "http://localhost:4201/api/v1"
DEFAULT_BASE_URL = os.environ.get("VNEXT_BASE_URL", "http://localhost:4201").rstrip("/")
BASE = DEFAULT_BASE_URL + "/api/v1" # main() icinde --base-url ile ezilir
DOMAIN = "core"
WF = "l1-cache-lab"
USER = "11111111-1111-1111-1111-111111111111"
Expand Down Expand Up @@ -191,11 +193,15 @@ def task_version_of(request_text, candidates):


def main():
global BASE
ap = argparse.ArgumentParser()
ap.add_argument("--minor", type=int, default=0,
help="calisma surumleri 1.{2N}.0 / 1.{2N+1}.0 olur; ayni runtime'a "
"tekrar kosum icin N'i artir (latest asserti ancak taze surumle anlamli)")
ap.add_argument("--base-url", default=DEFAULT_BASE_URL,
help="orchestrator base URL (varsayilan: VNEXT_BASE_URL ortam degiskeni ya da http://localhost:4201)")
args = ap.parse_args()
BASE = args.base_url.rstrip("/") + "/api/v1"

v_old = f"1.{2 * args.minor}.0"
v_new = f"1.{2 * args.minor + 1}.0"
Expand Down
6 changes: 3 additions & 3 deletions api-tests/script-perf-lab/perf-load.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ def http_text(url, timeout=30):
return -1, str(error)


def publish():
def publish(base_url):
"""Kardes publish.py'yi oldugu gibi calistirir; bilesen listesi orada tek yerde durur."""
path = Path(__file__).resolve().parent / "publish.py"
spec = importlib.util.spec_from_file_location("script_perf_lab_publish", path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module.main() == 0
return module.main(argv=[], base_url=base_url) == 0


def start_one(args, label):
Expand Down Expand Up @@ -337,7 +337,7 @@ def main():

if args.publish:
print("Publish:")
if not publish():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (broader_impact): perf-load.py still defaults its own --base-url to http://localhost:4201, so when only VNEXT_BASE_URL is set, publish(args.base_url) publishes to localhost instead of the configured orchestrator. The subsequent performance requests use the same hard-coded default and also ignore VNEXT_BASE_URL.

Triggers: When perf-load.py is run without --base-url and VNEXT_BASE_URL points to a non-default orchestrator.

Suggested fix: Give perf-load.py the same DEFAULT_BASE_URL = os.environ.get(...) default as the other scripts and use it for its argument parser.

if not publish(args.base_url):
return 1

if not args.skip_cold:
Expand Down
14 changes: 12 additions & 2 deletions api-tests/script-perf-lab/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
elle calistirma ve perf-load.py'nin --publish bayragi icindir.
"""

import argparse
import json
import os
import sys
import urllib.error
import urllib.request
from pathlib import Path

BASE = "http://localhost:4201/api/v1"
DEFAULT_BASE_URL = os.environ.get("VNEXT_BASE_URL", "http://localhost:4201").rstrip("/")
BASE = DEFAULT_BASE_URL + "/api/v1" # main() icinde --base-url ile ezilir
REPO = Path(__file__).resolve().parents[2]

COMPONENTS = [
Expand All @@ -46,7 +49,14 @@ def http(method, url, body=None):
return error.code, error.read().decode()


def main():
def main(argv=None, base_url=None):
"""Standalone: sys.argv parse eder. In-process cagiran (race-load/perf-load) argv=[] ve base_url verir."""
global BASE
ap = argparse.ArgumentParser(description="bilesenleri publish et")
ap.add_argument("--base-url", default=DEFAULT_BASE_URL,
help="orchestrator base URL (varsayilan: VNEXT_BASE_URL ortam degiskeni ya da http://localhost:4201)")
args = ap.parse_args(argv)
BASE = (base_url or args.base_url).rstrip("/") + "/api/v1"
for path in COMPONENTS:
document = json.loads(path.read_text())
status, response = http("POST", "%s/definitions/publish" % BASE, document)
Expand Down
14 changes: 12 additions & 2 deletions api-tests/script-race-lab/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
JMeter kosulari ve elle dogrulama icindir.
"""

import argparse
import json
import os
import sys
import urllib.error
import urllib.request
from pathlib import Path

BASE = "http://localhost:4201/api/v1"
DEFAULT_BASE_URL = os.environ.get("VNEXT_BASE_URL", "http://localhost:4201").rstrip("/")
BASE = DEFAULT_BASE_URL + "/api/v1" # main() icinde --base-url ile ezilir
REPO = Path(__file__).resolve().parents[2]

COMPONENTS = [
Expand All @@ -38,7 +41,14 @@ def http(method, url, body=None):
return error.code, error.read().decode()


def main():
def main(argv=None, base_url=None):
"""Standalone: sys.argv parse eder. In-process cagiran (race-load/perf-load) argv=[] ve base_url verir."""
global BASE
ap = argparse.ArgumentParser(description="bilesenleri publish et")
ap.add_argument("--base-url", default=DEFAULT_BASE_URL,
help="orchestrator base URL (varsayilan: VNEXT_BASE_URL ortam degiskeni ya da http://localhost:4201)")
args = ap.parse_args(argv)
BASE = (base_url or args.base_url).rstrip("/") + "/api/v1"
for path in COMPONENTS:
document = json.loads(path.read_text())
status, response = http("POST", "%s/definitions/publish" % BASE, document)
Expand Down
14 changes: 10 additions & 4 deletions api-tests/script-race-lab/race-load.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import argparse
import importlib.util
import json
import os
import statistics
import sys
import time
Expand All @@ -33,7 +34,8 @@
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path

BASE = "http://localhost:4201/api/v1"
DEFAULT_BASE_URL = os.environ.get("VNEXT_BASE_URL", "http://localhost:4201").rstrip("/")
BASE = DEFAULT_BASE_URL + "/api/v1" # main() icinde --base-url ile ezilir
DOMAIN = "core"
PARENT_WF = "script-race-lab-parent"
TERMINAL = {"C", "F", "P"}
Expand All @@ -60,13 +62,13 @@ def http(method, url, body=None, timeout=60):
return -1, {"error": str(error)}


def publish():
def publish(base_url):
"""Kardes publish.py'yi oldugu gibi calistirir; bilesen listesi orada tek yerde durur."""
path = Path(__file__).resolve().parent / "publish.py"
spec = importlib.util.spec_from_file_location("script_race_lab_publish", path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module.main() == 0
return module.main(argv=[], base_url=base_url) == 0


def start_one(index):
Expand Down Expand Up @@ -115,15 +117,19 @@ def settle_one(record, timeout_s):


def main():
global BASE
parser = argparse.ArgumentParser(description="script-race-lab paralel yuk surucusu")
parser.add_argument("--parallel", type=int, default=30, help="baslatilacak instance sayisi")
parser.add_argument("--publish", action="store_true", help="olcumden once publish adimini kos")
parser.add_argument("--timeout", type=int, default=180, help="instance basina settle butcesi (s)")
parser.add_argument("--base-url", default=DEFAULT_BASE_URL,
help="orchestrator base URL (varsayilan: VNEXT_BASE_URL ortam degiskeni ya da http://localhost:4201)")
args = parser.parse_args()
BASE = args.base_url.rstrip("/") + "/api/v1"

if args.publish:
print("Publish:")
if not publish():
if not publish(args.base_url):
return 1

print("\n%d instance baslatiliyor (max_workers=%d)..." % (args.parallel, args.parallel))
Expand Down
8 changes: 7 additions & 1 deletion api-tests/secret-cache-lab/secret-cache-behaviour-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

import argparse
import json
import os
import subprocess
import sys
import time
Expand All @@ -51,7 +52,8 @@
import uuid
from pathlib import Path

BASE = "http://localhost:4201/api/v1"
DEFAULT_BASE_URL = os.environ.get("VNEXT_BASE_URL", "http://localhost:4201").rstrip("/")
BASE = DEFAULT_BASE_URL + "/api/v1" # main() icinde --base-url ile ezilir
DOMAIN = "core"
WF = "secret-cache-lab"
USER = "11111111-1111-1111-1111-111111111111"
Expand Down Expand Up @@ -207,13 +209,17 @@ def summarize(tag, data, audit_delta):


def main():
global BASE
ap = argparse.ArgumentParser()
ap.add_argument("--ttl", type=int, default=30,
help="Runtime'daki Scripting:SecretCache:TtlSeconds degeri (varsayilan 30)")
ap.add_argument("--publish", action="store_true", help="Bilesenleri once publish et")
ap.add_argument("--keep-secret", action="store_true",
help="Test sonunda Vault'taki orijinal degeri geri yazma")
ap.add_argument("--base-url", default=DEFAULT_BASE_URL,
help="orchestrator base URL (varsayilan: VNEXT_BASE_URL ortam degiskeni ya da http://localhost:4201)")
args = ap.parse_args()
BASE = args.base_url.rstrip("/") + "/api/v1"

print("== On kosullar")
if not ensure_audit():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import base64
import concurrent.futures as cf
import json
import os
import subprocess
import sys
import threading
Expand All @@ -39,7 +40,8 @@
import uuid
from pathlib import Path

BASE = "http://localhost:4201/api/v1"
DEFAULT_BASE_URL = os.environ.get("VNEXT_BASE_URL", "http://localhost:4201").rstrip("/")
BASE = DEFAULT_BASE_URL + "/api/v1" # main() icinde --base-url ile ezilir
DOMAIN = "core"
PARENT_WF = "subflow-orchestration-parent"
CHILD_WF = "subflow-orchestration-child"
Expand Down Expand Up @@ -298,12 +300,16 @@ def publish_flows():


def main():
global BASE
ap = argparse.ArgumentParser()
ap.add_argument("--iterations", type=int, default=15)
ap.add_argument("--threshold", type=int, default=5)
ap.add_argument("--burst", type=int, default=4)
ap.add_argument("--publish", action="store_true", help="once flow'lari publish et")
ap.add_argument("--base-url", default=DEFAULT_BASE_URL,
help="orchestrator base URL (varsayilan: VNEXT_BASE_URL ortam degiskeni ya da http://localhost:4201)")
args = ap.parse_args()
BASE = args.base_url.rstrip("/") + "/api/v1"

if args.publish:
print("== Flow publish ==")
Expand Down
Loading
Loading