Skip to content

Commit c010df4

Browse files
authored
Updates int tests to BaSyx Go AASX File Server (#541)
* Updates int tests to BaSyx Go AASX File Server * Enhances integration test reporting with detailed failure diagnostics and request tracing * Fixes remaining errors * Fixes formatting issue
1 parent 107396f commit c010df4

9 files changed

Lines changed: 863 additions & 59 deletions

File tree

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,20 @@ pnpm test:engine --component aasx-file-server --url http://localhost:8087 --repo
130130

131131
### Report Behavior
132132

133-
- `console`: run summary plus failed checks and reasons.
134-
- `json`: machine-readable report for workflow processing.
135-
- `junit`: CI-compatible XML artifact.
136-
- `markdown`: shareable summary document.
133+
- `console`: run summary plus failed checks and reasons, including endpoint and response snippets when available.
134+
- `json`: machine-readable report for workflow processing, including failure diagnostics such as request
135+
method/endpoint, request body summary, response status, response body snippet, and trace source for integration-test
136+
failures.
137+
- `junit`: CI-compatible XML artifact; integration-test failure entries include endpoint and response context in the
138+
failure message.
139+
- `markdown`: shareable summary document with failure diagnostics and copyable cURL replay blocks for integration-test
140+
failures.
141+
142+
Failure diagnostics are captured only in test-engine mode and are sanitized:
143+
144+
- Authorization and cookie-style headers are redacted.
145+
- Large request/response bodies are truncated to compact snippets.
146+
- Multipart/binary replay commands use real relative file names when available; otherwise placeholders are emitted.
137147

138148
Exit code behavior:
139149

ci/basyxschema.sql

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ CREATE TABLE IF NOT EXISTS aas_descriptor_endpoint (
420420

421421
CREATE TABLE IF NOT EXISTS aas_descriptor (
422422
descriptor_id BIGINT PRIMARY KEY REFERENCES descriptor(id) ON DELETE CASCADE,
423+
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
423424
db_created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
424425
asset_kind int,
425426
asset_type VARCHAR(2048),
@@ -486,6 +487,19 @@ CREATE TABLE IF NOT EXISTS concept_description (
486487
db_updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
487488
);
488489

490+
-- ------------------------------------------
491+
-- Schema compatibility upgrades
492+
-- ------------------------------------------
493+
494+
ALTER TABLE IF EXISTS aas_descriptor
495+
ADD COLUMN IF NOT EXISTS created_at TIMESTAMPTZ NOT NULL DEFAULT NOW();
496+
497+
ALTER TABLE IF EXISTS aas_identifier
498+
ADD COLUMN IF NOT EXISTS db_created_at TIMESTAMPTZ NOT NULL DEFAULT NOW();
499+
500+
ALTER TABLE IF EXISTS aas_identifier
501+
ADD COLUMN IF NOT EXISTS db_updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW();
502+
489503
/*
490504
Auto-generated file. Do not edit manually.
491505
Naming pattern: <context>_reference and <context>_reference_key.
@@ -668,6 +682,31 @@ CREATE TABLE IF NOT EXISTS submodel_descriptor_supplemental_semantic_id_referenc
668682
db_updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
669683
);
670684

685+
-- ------------------------------------------
686+
-- AASX File Server
687+
-- ------------------------------------------
688+
689+
CREATE TABLE IF NOT EXISTS aasx_package (
690+
id BIGSERIAL PRIMARY KEY,
691+
package_id TEXT NOT NULL UNIQUE,
692+
file_oid OID NOT NULL,
693+
file_name TEXT NOT NULL,
694+
content_type TEXT NOT NULL DEFAULT 'application/asset-administration-shell-package',
695+
db_created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
696+
db_updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
697+
);
698+
699+
CREATE TABLE IF NOT EXISTS aasx_package_aas_id (
700+
id BIGSERIAL PRIMARY KEY,
701+
package_db_id BIGINT NOT NULL REFERENCES aasx_package(id) ON DELETE CASCADE,
702+
aas_id TEXT NOT NULL,
703+
position INTEGER NOT NULL,
704+
UNIQUE(package_db_id, position),
705+
UNIQUE(package_db_id, aas_id),
706+
db_created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
707+
db_updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
708+
);
709+
671710
-- ------------------------------------------
672711
-- Timestamp triggers
673712
-- ------------------------------------------
@@ -764,7 +803,6 @@ CREATE INDEX IF NOT EXISTS ix_operation_variable_operation_id ON operation_varia
764803
CREATE INDEX IF NOT EXISTS ix_operation_variable_value_sme ON operation_variable(value_sme);
765804

766805
CREATE UNIQUE INDEX IF NOT EXISTS ix_aas_identifier_aasid ON aas_identifier(aasId);
767-
CREATE INDEX IF NOT EXISTS ix_aas_identifier_db_created_at ON aas_identifier(db_created_at);
768806

769807
CREATE INDEX IF NOT EXISTS ix_specasset_descriptor_id_name ON specific_asset_id(descriptor_id, name);
770808
CREATE INDEX IF NOT EXISTS ix_specasset_descriptor_id_position ON specific_asset_id(descriptor_id, position);
@@ -787,6 +825,7 @@ CREATE INDEX IF NOT EXISTS ix_aas_endpoint_descriptor_position ON aas_descriptor
787825
CREATE INDEX IF NOT EXISTS ix_aas_endpoint_position ON aas_descriptor_endpoint(position);
788826

789827
CREATE INDEX IF NOT EXISTS ix_aasd_db_created_at ON aas_descriptor(db_created_at);
828+
CREATE INDEX IF NOT EXISTS ix_aasd_created_at ON aas_descriptor(created_at);
790829
CREATE INDEX IF NOT EXISTS ix_aasd_id_short ON aas_descriptor(id_short);
791830
CREATE INDEX IF NOT EXISTS ix_aasd_global_asset_id ON aas_descriptor(global_asset_id);
792831
CREATE INDEX IF NOT EXISTS ix_aasd_id_trgm ON aas_descriptor USING GIN (id gin_trgm_ops);
@@ -847,3 +886,8 @@ CREATE INDEX IF NOT EXISTS ix_specasset_supp_semantic_refkey_refid ON specific_a
847886
CREATE INDEX IF NOT EXISTS ix_specasset_supp_semantic_refkey_refval ON specific_asset_id_supplemental_semantic_id_reference_key(reference_id, value);
848887
CREATE INDEX IF NOT EXISTS ix_specasset_supp_semantic_refkey_type_val ON specific_asset_id_supplemental_semantic_id_reference_key(type, value);
849888
CREATE INDEX IF NOT EXISTS ix_specasset_supp_semantic_refkey_val_trgm ON specific_asset_id_supplemental_semantic_id_reference_key USING GIN (value gin_trgm_ops);
889+
890+
CREATE INDEX IF NOT EXISTS ix_aasx_package_package_id ON aasx_package(package_id);
891+
CREATE INDEX IF NOT EXISTS ix_aasx_package_db_created_at ON aasx_package(db_created_at);
892+
CREATE INDEX IF NOT EXISTS ix_aasx_package_aas_id_aas ON aasx_package_aas_id(aas_id);
893+
CREATE INDEX IF NOT EXISTS ix_aasx_package_aas_id_package ON aasx_package_aas_id(package_db_id);

ci/docker-compose.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,30 @@ services:
163163

164164
# AASX File Server
165165
aasx-file-server:
166-
image: eclipsebasyx/aasxfileserver:2.0.0-milestone-08
166+
image: eclipsebasyx/aasxfileserver-go:SNAPSHOT
167167
container_name: aasx-file-server
168+
command: ["/app/aasxfileserver"]
168169
ports:
169170
- '8087:8081'
170171
environment:
171172
# Service Configuration
172-
SERVER_PORT: 8081
173-
BASYX_BACKEND: "InMemory"
174-
BASYX_CORS_ALLOWED_ORIGINS: "*"
175-
BASYX_CORS_ALLOWED_METHODS: "GET, POST, PATCH, DELETE, PUT, OPTIONS, HEAD"
173+
- SERVER_PORT=8081
174+
- CORS_ALLOWEDORIGINS=*
175+
- CORS_ALLOWEDHEADERS=*
176+
- CORS_ALLOWEDCREDENTIALS=true
177+
- CORS_ALLOWEDMETHODS=GET,POST,PUT,PATCH,DELETE,OPTIONS
178+
- POSTGRES_HOST=db
179+
- POSTGRES_PORT=5432
180+
- POSTGRES_USER=admin
181+
- POSTGRES_PASSWORD=admin123
182+
- POSTGRES_DBNAME=basyxTestDB
183+
- POSTGRES_MAXOPENCONNECTIONS=500
184+
- POSTGRES_MAXIDLECONNECTIONS=500
185+
- POSTGRES_CONNMAXLIFETIMEMINUTES=5
186+
- ABAC_ENABLED=false
187+
depends_on:
188+
db-schema-init:
189+
condition: service_completed_successfully
176190

177191
# PostgreSQL database
178192
db:

0 commit comments

Comments
 (0)