In our CI we download the schema files from admin-shell-io/aas-specs to use them in the sdk-test job.
|
- name: Collect schema files from aas-specs |
|
run: | |
|
mkdir -p ./test/adapter/schema |
|
curl -sSL -o ./test/adapter/schema/aasJSONSchema.json https://raw.githubusercontent.com/admin-shell-io/aas-specs/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/json/aas.json |
|
curl -sSL -o ./test/adapter/schema/aasXMLSchema.xsd https://raw.githubusercontent.com/admin-shell-io/aas-specs/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/xml/AAS.xsd |
For the currently set variable value AAS_SPECS_RELEASE_TAG: "IDTA-01001-3-1-2" these URLs do not exist.
Despite the 404 response code of the HTTP Request cURL finishes with status code 0 and the CI step does not fail.
The sdk tests simply skip the tests, that require the schema files:
|
class JsonSerializationSchemaTest(unittest.TestCase): |
|
@classmethod |
|
def setUpClass(cls): |
|
if not os.path.exists(JSON_SCHEMA_FILE): |
|
raise unittest.SkipTest(f"JSON Schema does not exist at {JSON_SCHEMA_FILE}, skipping test") |
|
class XMLSerializationSchemaTest(unittest.TestCase): |
|
@classmethod |
|
def setUpClass(cls): |
|
if not os.path.exists(XML_SCHEMA_FILE): |
|
raise unittest.SkipTest(f"XSD schema does not exist at {XML_SCHEMA_FILE}, skipping test") |
This explains why this bug stayed unnoticed for so long. To avoid this in future I suggest to
In our CI we download the schema files from
admin-shell-io/aas-specsto use them in thesdk-testjob.basyx-python-sdk/.github/workflows/ci.yml
Lines 80 to 84 in ca78e9a
For the currently set variable value
AAS_SPECS_RELEASE_TAG: "IDTA-01001-3-1-2"these URLs do not exist.Despite the
404response code of the HTTP RequestcURLfinishes with status code0and the CI step does not fail.The sdk tests simply skip the tests, that require the schema files:
basyx-python-sdk/sdk/test/adapter/json/test_json_serialization.py
Lines 50 to 54 in ca78e9a
basyx-python-sdk/sdk/test/adapter/xml/test_xml_serialization.py
Lines 50 to 54 in ca78e9a
This explains why this bug stayed unnoticed for so long. To avoid this in future I suggest to
-fflag to thecurlcall to exit non-zero on any errors