Commit 8a407fbd authored by kzangeli's avatar kzangeli
Browse files

Merge branch 'fix/051-jsonld-contexts' into integration/all-fixes

# Conflicts:
#	testsuite-doubts.md
parents 80d354ac 39921641
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -56,7 +56,10 @@ Create Initial @context condition from an external server
    Start @context Local Server

    ${uri}=    Catenate    http://${context_server_host}:${context_server_port}${uri}
    Set Global Variable    ${uri}
    # Suite scope, NOT global — a global ${uri} bleeds into the other
    # jsonldContext suites sharing the same variable name, and their own
    # Catenate then doubles the URL (testsuite-doubts.md #97).
    Set Suite Variable    ${uri}

    Create Entity selecting @context    ${entityfile}    ${uri}

+2 −1
Original line number Diff line number Diff line
@@ -52,7 +52,8 @@ Create Initial @context condition from an external server
    Set Global Variable    ${first_existing_entity_id}

    ${uri}=    Catenate    SEPARATOR=    http://${context_server_host}:${context_server_port}    ${uri}
    Set Global Variable    ${uri}
    # Suite scope, NOT global — see testsuite-doubts.md #97.
    Set Suite Variable    ${uri}

    Create Entity selecting @context    ${entityfile}    ${uri}    ${first_existing_entity_id}
    ${response}=    Serve a @context
+4 −1
Original line number Diff line number Diff line
@@ -21,7 +21,10 @@ ${reason_422}= Unprocessable
*** Test Cases ***    CONTEXTID    RELOAD    STATUSCODE    REASON    ERROR
051_04_01 Delete A @contexts With A Wrong Id And Reload Set To True
    [Tags]    ctx-delete    5_13_5    since_v1.5.1
    wrong_id_context    true    400    ${reason_400}    ${ERROR_TYPE_BAD_REQUEST_DATA}
    # An identifier that "does not correspond to any existing entry" is
    # ResourceNotFound (clause 13.5.4) — reload only enters the picture for
    # an EXISTING @context (testsuite-doubts.md #97).
    wrong_id_context    true    404    ${reason_404}    ${ERROR_TYPE_RESOURCE_NOT_FOUND}
051_04_02 Delete A @contexts With A Wrong Id And Reload Set To False
    [Tags]    ctx-delete    5_13_5    since_v1.5.1
    wrong_id_context    false    404    ${reason_404}    ${ERROR_TYPE_RESOURCE_NOT_FOUND}
+5 −2
Original line number Diff line number Diff line
@@ -42,8 +42,11 @@ ${uri} /api/v1/context.jsonld
Create Initial @context condition from an external server
    Start @context Local Server

    # ${uri}=    Catenate    http://${context_server_host}:${context_server_port}${uri}
    Set Global Variable    ${uri}
    ${uri}=    Catenate    http://${context_server_host}:${context_server_port}${uri}
    # Suite scope, NOT global — with the Catenate above commented out this
    # suite silently depended on the absolute URL another suite happened to
    # leave in the global ${uri} (testsuite-doubts.md #97).
    Set Suite Variable    ${uri}

    Create Entity selecting @context    ${entityfile}    ${uri}

+33 −0
Original line number Diff line number Diff line
@@ -3324,3 +3324,36 @@ parenthesis — genuinely invalid), mirroring `037_03_02`.
(The `notification_result_regex_expr` variable and the assertionUtils.py
`threshold_to_diff_deeper=0` fix are re-declared identically to their origin
branch since that MR is unmerged — git deduplicates on merge.)


## 97. jsonldContext family — global `${uri}` doubling, and wrong-id deletes are 404, not 400

Three intertwined defects around `/jsonldContexts` (051/053):

**a) Global `${uri}` doubling (`051_05_01`, `053_06_01`, and latently
`053_05_01`):** three suites share the file-level variable
`${uri} = /api/v1/context.jsonld` and their setups run
`Catenate http://host:port + ${uri}` followed by `Set GLOBAL Variable ${uri}`.
In a full run, whichever suite executes first publishes the ABSOLUTE URL
globally; the next suite's Catenate then doubles it
(`http://0.0.0.0:8087http://0.0.0.0:8087/api/v1/context.jsonld`) and every
follow-up request 404s. `051_05_01`'s Catenate was even commented out at some
point — making it silently depend on the absolute URL another suite happened
to leave behind. Fixed: each suite catenates its own and uses
`Set Suite Variable`.

**b) `051_02_01` / `051_04_02` / `051_04_03` (broker side, recorded for
context):** the contextId is a "locally unique identifier" (clause 13.5.3) —
no URI shape applies, so a non-URI id is simply unknown and clause 13.5.4
mandates ResourceNotFound. The broker returned 400 for non-URI ids; fixed
broker-side.

**c) `051_04_01` — wrong id + `reload=true` expects 400:** clause 13.5.4's
"identifier does not correspond to any existing entry → ResourceNotFound"
applies to any unknown id; the reload bullets describe behaviour for an
EXISTING @context ("the kind of the @context"). Expectation corrected to
404/ResourceNotFound.

(The 051_05/053_05 503→504 status expectations are re-declared identically
to their origin branch since that MR is unmerged — git deduplicates on
merge.)