@@ -115,7 +115,6 @@ jobs:
115115 run : |
116116 cd ${{ github.workspace }}
117117 git clone https://github.com/quarkiverse/quarkus-langchain4j.git
118- echo "✅ Quarkus LangChain4j cloned"
119118
120119 # Step 3: Build Quarkus LangChain4j (optimized)
121120 - name : Build Quarkus LangChain4j
@@ -127,16 +126,14 @@ jobs:
127126 # This recompiles everything with the same Java version, avoiding compatibility issues
128127 # The -Dtornado flag activates the TornadoVM profile which includes gpu-llama3 module
129128 mvn clean install -pl integration-tests/gpu-llama3 -am -DskipTests -Dtornado
130-
131- echo "✅ Quarkus LangChain4j built (GPULlama3 integration test + dependencies)"
132129
133- # Step 4: Run Integration Test
134- - name : Run Integration Test
130+ # Step 4: Start Quarkus Application and Wait for Startup
131+ - name : Start Quarkus Application and Wait for Startup
135132 run : |
136133 cd ${{ github.workspace }}/quarkus-langchain4j/integration-tests/gpu-llama3
137134 export PATH="$TORNADO_SDK/bin:$JAVA_HOME/bin:$PATH"
138135
139- echo "Running Quarkus-Langchain4j integration test on port $QUARKUS_PORT"
136+ echo "Starting Quarkus application on port $QUARKUS_PORT... "
140137
141138 # Start the Quarkus application in the background
142139 java @"$TORNADO_SDK/tornado-argfile" \
@@ -145,30 +142,66 @@ jobs:
145142 -jar target/quarkus-app/quarkus-run.jar &
146143 APP_PID=$!
147144
148- # Wait for the application to start
149- echo "Starting Quarkus application on port $QUARKUS_PORT..."
145+ if [ -z "$APP_PID" ]; then
146+ echo "ERROR: Failed to start Quarkus application"
147+ exit 1
148+ fi
149+
150+ echo "Waiting for Quarkus application to start..."
151+
152+ # Wait for application to be ready
150153 for i in {1..30}; do
151154 if curl -s http://localhost:$QUARKUS_PORT/q/health > /dev/null 2>&1; then
152- echo "✅ Application started successfully"
155+ echo "Application ready after ${i} seconds"
156+ echo "Health endpoint: http://localhost:$QUARKUS_PORT/q/health"
153157 break
154158 elif [ $i -eq 30 ]; then
155- echo "❌ Application failed to start within 30 seconds"
159+ echo "ERROR: Application failed to start within 30 seconds"
160+ echo "Debugging info:"
161+ echo "- Port: $QUARKUS_PORT"
162+ echo "- Process ID: $APP_PID"
163+ echo "- Health URL: http://localhost:$QUARKUS_PORT/q/health"
156164 kill $APP_PID || true
157165 exit 1
158166 else
167+ [ $((i % 5)) -eq 0 ] && echo "Still waiting... (${i}s)"
159168 sleep 1
160169 fi
161170 done
162-
163- # Trigger endpoints
171+
172+ # Step 5: Run test 1
173+ - name : Trigger Blocking Endpoint
174+ run : |
175+ # Trigger endpoint
164176 BLOCKING_RESPONSE=$(curl -s -w "%{http_code}" http://localhost:$QUARKUS_PORT/chat/blocking)
165- STREAMING_RESPONSE=$(timeout 10s curl -s -w "%{http_code}" http://localhost:$QUARKUS_PORT/chat/streaming)
177+ BLOCKING_HTTP_RESPONSE_CODE="${BLOCKING_RESPONSE: -3}"
166178
167- echo "Blocking endpoint HTTP code: ${BLOCKING_RESPONSE: -3}"
168- echo "Streaming endpoint HTTP code: ${STREAMING_RESPONSE: -3}"
179+ # Check response code
180+ if [ "$BLOCKING_HTTP_RESPONSE_CODE" != "200" ]; then
181+ echo "ERROR: Blocking endpoint returned HTTP code $BLOCKING_HTTP_RESPONSE_CODE"
182+ exit 1
183+ else
184+ echo "Blocking endpoint HTTP code: ${BLOCKING_RESPONSE: -3}"
185+ fi
186+
187+ # Step 6: Run test 2
188+ - name : Trigger Streaming Endpoint
189+ run : |
190+ # Trigger endpoint
191+ STREAMING_RESPONSE=$(timeout 10s curl -s -w "%{http_code}" http://localhost:$QUARKUS_PORT/chat/streaming)
192+ STREAMING_HTTP_RESPONSE_CODE="${STREAMING_RESPONSE: -3}"
169193
194+ # Check response code
195+ if [ "STREAMING_HTTP_RESPONSE_CODE" != "200" ]; then
196+ echo "ERROR: Streaming endpoint returned HTTP code STREAMING_HTTP_RESPONSE_CODE"
197+ exit 1
198+ else
199+ echo "Streaming endpoint HTTP code: ${STREAMING_RESPONSE: -3}"
200+ fi
201+
202+ # Step 7: Cleanup & Shutdown
203+ - name : Cleanup & Shutdown
204+ run : |
170205 # Clean shutdown
171206 kill $APP_PID || true
172207 wait $APP_PID 2>/dev/null || true
173-
174- echo "✅ Integration test completed successfully"
0 commit comments