1818 timeout-minutes : 30
1919
2020 steps :
21- - uses : actions/checkout@v3
21+ - uses : actions/checkout@v4
2222
2323 - name : Update local repository
2424 run : |
@@ -39,10 +39,35 @@ jobs:
3939 # Stop all services
4040 docker compose \
4141 --env-file .env.docker-compose-preprod \
42- --env-file .env.docker-compose-profile-entry -level \
42+ --env-file .env.docker-compose-profile-mid -level \
4343 -f docker-compose.yaml \
4444 down
4545
46+ - name : Configure environment for full-history tests
47+ run : |
48+ cd /home/integration/git/cardano-rosetta-java
49+
50+ ensure_var() {
51+ local key="$1"
52+ local value="$2"
53+ local file=".env.docker-compose-preprod"
54+ if grep -q "^${key}=" "$file"; then
55+ sed -i "s#^${key}=.*#${key}=${value}#" "$file"
56+ else
57+ echo "${key}=${value}" >> "$file"
58+ fi
59+ }
60+
61+ ensure_var REMOVE_SPENT_UTXOS false
62+ ensure_var REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT 129600
63+ ensure_var DB_PORT 5433
64+ ensure_var TOKEN_REGISTRY_ENABLED true
65+ ensure_var TOKEN_REGISTRY_BASE_URL http://preview.integrations.cf-systems.internal:8080/api
66+ ensure_var TOKEN_REGISTRY_CACHE_TTL_HOURS 1
67+ ensure_var TOKEN_REGISTRY_LOGO_FETCH true
68+ ensure_var TOKEN_REGISTRY_REQUEST_TIMEOUT_SECONDS 2
69+ ensure_var PEER_DISCOVERY true
70+
4671
4772 - name : Build and start services with PR code
4873 run : |
5580 # Build and start all services
5681 docker compose \
5782 --env-file .env.docker-compose-preprod \
58- --env-file .env.docker-compose-profile-entry -level \
83+ --env-file .env.docker-compose-profile-mid -level \
5984 -f docker-compose.yaml \
6085 up --build -d --wait
6186
@@ -110,6 +135,17 @@ jobs:
110135 # Sync Python dependencies
111136 uv sync
112137
138+ - name : Create test environment file
139+ run : |
140+ cd /home/integration/git/cardano-rosetta-java
141+
142+ # Merge env files so tests can read actual configuration
143+ cat .env.docker-compose-preprod > .env.test
144+ cat .env.docker-compose-profile-mid-level >> .env.test
145+
146+ # Copy to tests directory
147+ cp .env.test tests/data-endpoints/.env
148+
113149 - name : Run smoke tests (validate test data)
114150 id : smoke_tests
115151 run : |
@@ -142,6 +178,7 @@ jobs:
142178
143179 # Run behavioral tests (skip smoke tests)
144180 uv run pytest -m "not smoke" \
181+ -n auto \
145182 --alluredir=./allure-results \
146183 --tb=short \
147184 -v || TEST_RESULT=$?
@@ -155,6 +192,27 @@ jobs:
155192 ROSETTA_URL : http://localhost:8082
156193 CARDANO_NETWORK : preprod
157194
195+ - name : Run construction API tests
196+ id : construction_test
197+ run : |
198+ export PATH="$HOME/.local/bin:$PATH"
199+
200+ cd /home/integration/git/cardano-rosetta-java/tests/integration
201+
202+ # Run construction API snapshot tests
203+ uv run test_construction_api.py \
204+ -v || CONSTRUCTION_RESULT=$?
205+
206+ # Output test result
207+ echo "construction_result=${CONSTRUCTION_RESULT:-0}" >> $GITHUB_OUTPUT
208+
209+ # Don't fail the whole job if construction tests fail
210+ # These are informational for now
211+ exit 0
212+ env :
213+ ROSETTA_URL : http://localhost:8082
214+ CARDANO_NETWORK : preprod
215+
158216 - name : Generate Allure report
159217 if : always()
160218 run : |
@@ -217,23 +275,26 @@ jobs:
217275 if : failure() && (steps.test.outcome == 'failure' || steps.test.outcome == 'cancelled')
218276 run : |
219277 cd /home/integration/git/cardano-rosetta-java
278+ sed -i "s#^DB_PORT=.*#DB_PORT=5433#" .env.docker-compose-preprod
220279
221280 echo "⚠️ Test failed - stopping services"
222281
223282 # Stop all services cleanly
224283 docker compose \
225284 --env-file .env.docker-compose-preprod \
226- --env-file .env.docker-compose-profile-entry -level \
285+ --env-file .env.docker-compose-profile-mid -level \
227286 -f docker-compose.yaml \
228287 down
229288
230289 # Check if migrations changed in this PR
231290 LAST_TAG=$(git tag --sort=-version:refname | head -1)
232- git checkout $LAST_TAG
291+ git checkout -f $LAST_TAG
292+ sed -i "s#^DB_PORT=.*#DB_PORT=5433#" .env.docker-compose-preprod
233293
234294 STABLE_MIGRATION_HASH=$(find yaci-indexer/src/main/resources/db/store -type f -name 'V*.sql' -exec md5sum {} \; | sort | md5sum | cut -d' ' -f1)
235295
236- git checkout -
296+ git checkout -f -
297+ sed -i "s#^DB_PORT=.*#DB_PORT=5433#" .env.docker-compose-preprod
237298 PR_MIGRATION_HASH=$(find yaci-indexer/src/main/resources/db/store -type f -name 'V*.sql' -exec md5sum {} \; | sort | md5sum | cut -d' ' -f1)
238299
239300 if [ "$STABLE_MIGRATION_HASH" != "$PR_MIGRATION_HASH" ]; then
@@ -242,7 +303,7 @@ jobs:
242303 # Start only the database
243304 docker compose \
244305 --env-file .env.docker-compose-preprod \
245- --env-file .env.docker-compose-profile-entry -level \
306+ --env-file .env.docker-compose-profile-mid -level \
246307 -f docker-compose.yaml \
247308 up -d db
248309
@@ -262,33 +323,34 @@ jobs:
262323 for VERSION in $CHANGED_MIGRATIONS; do
263324 echo "Removing Flyway metadata for version: $VERSION"
264325 docker exec cardano-rosetta-java-db-1 sh -c \
265- "PGPASSWORD=weakpwd#123_d psql -U rosetta_db_admin -d rosetta-java \
326+ "PGPASSWORD=weakpwd#123_d psql -U rosetta_db_admin -d rosetta-java -p 5433 \
266327 -c \"DELETE FROM preprod.flyway_schema_history WHERE version LIKE '${VERSION}%';\""
267328 done
268329
269330 echo "✓ Flyway metadata cleaned - all blockchain data preserved"
270331 else
271332 echo "No specific migration versions detected - truncating flyway history"
272333 docker exec cardano-rosetta-java-db-1 sh -c \
273- "PGPASSWORD=weakpwd#123_d psql -U rosetta_db_admin -d rosetta-java \
334+ "PGPASSWORD=weakpwd#123_d psql -U rosetta_db_admin -d rosetta-java -p 5433 \
274335 -c 'TRUNCATE preprod.flyway_schema_history;'"
275336 fi
276337
277338 docker compose \
278339 --env-file .env.docker-compose-preprod \
279- --env-file .env.docker-compose-profile-entry -level \
340+ --env-file .env.docker-compose-profile-mid -level \
280341 -f docker-compose.yaml \
281342 down
282343 fi
283344
284345 # Now safe to rollback
285346 LAST_TAG=$(git tag --sort=-version:refname | head -1)
286347 echo "Rolling back to stable version: $LAST_TAG"
287- git checkout $LAST_TAG
348+ git checkout -f $LAST_TAG
349+ sed -i "s#^DB_PORT=.*#DB_PORT=5433#" .env.docker-compose-preprod
288350
289351 docker compose \
290352 --env-file .env.docker-compose-preprod \
291- --env-file .env.docker-compose-profile-entry -level \
353+ --env-file .env.docker-compose-profile-mid -level \
292354 -f docker-compose.yaml \
293355 up -d
294356
@@ -305,4 +367,10 @@ jobs:
305367 sleep 5
306368 done
307369
308- echo "✅ Rollback to $LAST_TAG completed"
370+ echo "✅ Rollback to $LAST_TAG completed"
371+
372+ - name : Restore baseline configuration
373+ if : always()
374+ run : |
375+ cd /home/integration/git/cardano-rosetta-java
376+ git restore .env.docker-compose-preprod
0 commit comments