Commit aa9f956c authored by kzangeli's avatar kzangeli
Browse files

refactor: the context branch is a variable, not a hardcoded name



Hardcoding this branch is right for us and unacceptable upstream, where the
default has to stay `develop`. NGSILD_TEST_SUITE_BRANCH makes it one environment
variable: a fork points the suite at itself, upstream keeps its own default, and
the change becomes proposable rather than fork-only.

Ours defaults to integration/all-fixes, so a bare `robot` run here uses the
context these tests were written against without anyone having to remember a
variable - which is the failure mode being fixed, not a convenience.

Co-Authored-By: default avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
parent 794c8a2d
Loading
Loading
Loading
Loading
+19 −7
Original line number Diff line number Diff line
import os as _os

url = 'http://localhost:8080/ngsi-ld/v1'
temporal_api_url = 'http://localhost:8080/ngsi-ld/v1'
# The context this branch's tests are written against, served from THIS branch.
# It used to name `develop`, which meant every fork - however carefully corrected -
# handed the broker upstream's context at runtime, and a change there altered what
# our tests meant with no commit on our side. That is how `isParked` became an
# expanded IRI overnight. The compound context references its sibling RELATIVELY,
# so this pair follows whichever branch serves it.
ngsild_test_suite_context = 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/integration/all-fixes/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'
# Which branch serves the @context the tests are written against.
#
# This used to be hardcoded to `develop`, so every run of every fork - however
# carefully corrected - handed the broker UPSTREAM's context at runtime, and a
# change there altered what our tests meant with no commit on our side. That is
# how `isParked` became an expanded IRI overnight.
#
# A branch name, not a URL, so a fork points the suite at itself with one
# environment variable and upstream keeps its own default. The compound context
# references its sibling RELATIVELY, so the pair follows whichever branch serves
# it.
_context_branch = _os.environ.get("NGSILD_TEST_SUITE_BRANCH", "integration/all-fixes")

ngsild_test_suite_context = (
    "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/"
    f"{_context_branch}/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
)
notification_server_host = '0.0.0.0'
notification_server_port = 8085
mqtt_broker_host = '127.0.0.1'