@@ -141,13 +141,94 @@ jobs:
141141 working-directory : cli
142142 run : |
143143 ./opentaint compile --quiet ${{ steps.github-token.outputs.arg }} --output portable-project ../project-root --verbosity debug
144- ./opentaint scan --quiet ${{ steps.github-token.outputs.arg }} --output report.sarif portable-project --verbosity debug
144+ ./opentaint scan --quiet ${{ steps.github-token.outputs.arg }} --output report.sarif --project-model portable-project --verbosity debug
145145
146- - name : Run opentaint scan
146+ - name : Run opentaint scan with explicit path and output
147147 working-directory : cli
148148 run : |
149149 ./opentaint scan --quiet ${{ steps.github-token.outputs.arg }} --output report.sarif ../project-root
150150
151+ - name : Clean up cached models before default-output tests
152+ working-directory : cli
153+ run : ./opentaint prune --yes ${{ steps.github-token.outputs.arg }}
154+
155+ - name : Run opentaint scan with default output (CompileAndScan)
156+ working-directory : cli
157+ run : |
158+ ./opentaint scan --quiet ${{ steps.github-token.outputs.arg }} ../project-root
159+
160+ - name : Verify cached model and default SARIF location
161+ run : |
162+ # Exactly one project cache directory should exist
163+ MODEL_COUNT=$(ls -d ~/.opentaint/cache/*/ 2>/dev/null | wc -l)
164+ if [ "$MODEL_COUNT" -ne 1 ]; then
165+ echo "Expected 1 cached model directory, found $MODEL_COUNT"
166+ ls -la ~/.opentaint/cache/ || true
167+ exit 1
168+ fi
169+
170+ CACHE_DIR=$(ls -d ~/.opentaint/cache/*/)
171+
172+ # project-model directory should exist
173+ if [ ! -d "${CACHE_DIR}project-model" ]; then
174+ echo "Expected project-model directory in $CACHE_DIR"
175+ ls -la "$CACHE_DIR"
176+ exit 1
177+ fi
178+
179+ # Default SARIF should be inside project-model/sources/
180+ SARIF_PATH="${CACHE_DIR}project-model/sources/opentaint.sarif"
181+ if [ ! -f "$SARIF_PATH" ]; then
182+ echo "Expected default SARIF at $SARIF_PATH"
183+ find "$CACHE_DIR" -name "*.sarif" || true
184+ exit 1
185+ fi
186+
187+ echo "Cached model verified at: $CACHE_DIR"
188+ echo "Default SARIF verified at: $SARIF_PATH"
189+
190+ - name : Run opentaint scan with no arguments (defaults to current directory)
191+ working-directory : project-root
192+ run : |
193+ ../cli/opentaint scan --quiet ${{ steps.github-token.outputs.arg }}
194+
195+ - name : Run opentaint scan on pre-compiled model without --output
196+ working-directory : cli
197+ run : |
198+ ./opentaint scan --quiet ${{ steps.github-token.outputs.arg }} --project-model portable-project
199+
200+ - name : Verify SARIF placed inside provided project-model
201+ working-directory : cli
202+ run : |
203+ if [ ! -f "portable-project/sources/opentaint.sarif" ]; then
204+ echo "Expected SARIF at portable-project/sources/opentaint.sarif"
205+ find portable-project -name "*.sarif" || true
206+ exit 1
207+ fi
208+ echo "SARIF in explicit project-model verified"
209+
210+ - name : Run opentaint prune --dry-run and verify cached models listed
211+ working-directory : cli
212+ run : |
213+ OUTPUT=$(./opentaint prune --dry-run 2>&1)
214+ if ! echo "$OUTPUT" | grep -q "model"; then
215+ echo "Expected prune --dry-run to list cached model artifacts"
216+ echo "$OUTPUT"
217+ exit 1
218+ fi
219+ echo "Prune dry-run correctly lists cached models"
220+
221+ - name : Run opentaint prune --yes and verify cached models removed
222+ working-directory : cli
223+ run : |
224+ ./opentaint prune --yes
225+ if [ -d ~/.opentaint/cache ] && [ "$(ls -A ~/.opentaint/cache 2>/dev/null)" ]; then
226+ echo "Expected cache directory to be empty after prune"
227+ ls -la ~/.opentaint/cache/
228+ exit 1
229+ fi
230+ echo "Prune correctly removed cached models"
231+
151232 run-on-petclinic-windows :
152233 runs-on : windows-latest
153234
@@ -185,7 +266,7 @@ jobs:
185266 working-directory : cli
186267 run : |
187268 ./opentaint compile --quiet ${{ steps.github-token.outputs.arg }} --output portable-project ../project-root --verbosity debug
188- ./opentaint scan --quiet ${{ steps.github-token.outputs.arg }} --output report.sarif portable-project --verbosity debug
269+ ./opentaint scan --quiet ${{ steps.github-token.outputs.arg }} --output report.sarif --project-model portable-project --verbosity debug
189270
190271 - name : Run opentaint scan
191272 working-directory : cli
@@ -232,7 +313,7 @@ jobs:
232313 - name : Run opentaint scan
233314 working-directory : cli
234315 run : |
235- ./opentaint scan ${{ steps.github-token.outputs.arg }} --output stirling-pdf-report.sarif stirling-pdf-model
316+ ./opentaint scan ${{ steps.github-token.outputs.arg }} --output stirling-pdf-report.sarif --project-model stirling-pdf-model
236317
237318 test-install-sh-linux :
238319 runs-on : ubuntu-latest
0 commit comments