telstra / open-kilda

OpenKilda is an open-source OpenFlow controller initially designed for use in a global network with high control-plane latency and a heavy emphasis on latency-centric data path optimisation.
Apache License 2.0
77 stars 53 forks source link

Test Framework: Improvement: Errors verification #5694

Open yuliiamir opened 1 week ago

yuliiamir commented 1 week ago

In the scope of this task, the verification of the expected error should be modified by using existing/adding new errors. Example: from

 def exc = thrown(HttpClientErrorException)
        exc.rawStatusCode == 409
        def error = exc.responseBodyAsString.to(MessageError)
        error.errorMessage == "Could not swap endpoints"
        error.errorDescription.contains("Requested flow '$flow1.id' conflicts with existing flow '$flow3.id'.")

to

def exc = thrown(HttpClientErrorException)
        new FlowEndpointsNotSwappedExpectedError(HttpStatus.CONFLICT,
                ~/Requested flow '${flow1.flowId}' conflicts with existing flow '${flow3.flowId}'./).matches(exc)

Specs inside folders: ha-flow, y-flow, links, switches, logging, network Note, during regular flow refactoring this interaction was modified (if something is left, please update it). it seems like we have some old leftovers to modify.

Also, need to review and add appropriate changes according to these comments: https://github.com/telstra/open-kilda/pull/5687/files#r1652283792 https://github.com/telstra/open-kilda/pull/5687/files#r1652301802

yuliiamir commented 1 day ago

https://github.com/telstra/open-kilda/pull/5697