fix: show query output when expect-results fails #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Setup vlt | |
| uses: vltpkg/setup-vlt@v1 | |
| - name: Create test project | |
| run: | | |
| mkdir test-project | |
| cd test-project | |
| vlt init --yes | |
| echo "Test project created with empty vlt project" | |
| - name: Test single query - list all deps | |
| uses: ./ | |
| with: | |
| query: '*' | |
| view: 'human' | |
| working-directory: './test-project' | |
| - name: Test single query with count view | |
| uses: ./ | |
| with: | |
| query: '*' | |
| view: 'count' | |
| working-directory: './test-project' | |
| - name: Test multi-query on project | |
| uses: ./ | |
| with: | |
| working-directory: './test-project' | |
| queries: | | |
| # No malware expected | |
| :malware --expect-results=0 | |
| # List all with json | |
| * --view=json | |
| - name: Test failure case (expect exactly 999 deps - should fail) | |
| id: expected-failure | |
| continue-on-error: true | |
| uses: ./ | |
| with: | |
| query: '*' | |
| expect-results: '999' | |
| working-directory: './test-project' | |
| - name: Verify failure case actually failed | |
| if: steps.expected-failure.outcome != 'failure' | |
| run: | | |
| echo "::error::Expected the previous step to fail, but it passed" | |
| exit 1 | |
| - name: Integration tests completed | |
| run: echo "All integration tests completed successfully" | |
| test-without-vlt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Test without vlt installed (should fail) | |
| id: no-vlt | |
| continue-on-error: true | |
| uses: ./ | |
| with: | |
| query: ':malware' | |
| - name: Verify vlt check failed | |
| if: steps.no-vlt.outcome != 'failure' | |
| run: | | |
| echo "::error::Expected action to fail when vlt is not installed" | |
| exit 1 |