Skip to content

Commit

Permalink
Fix: get container ID for the first container only.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Aug 29, 2024
1 parent ead665b commit 02480e2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ jobs:
working-directory: tests/${{ matrix.entry.tests || 'default' }}
run: docker compose up -d

- name: Get Container ID
id: container
run: |
echo "CONTAINER_ID=$(docker ps -aqf "ancestor=opensearchproject/opensearch:${{ matrix.entry.version }}")" >> $GITHUB_OUTPUT
- name: Run Tests
run: |
npm run test:spec -- \
Expand All @@ -83,10 +78,11 @@ jobs:
--tests=tests/${{ matrix.entry.tests || 'default' }}
- name: Get Container Logs
if: failure() && steps.container.outputs.CONTAINER_ID
run: |
echo Dumping logs from ${{ steps.container.outputs.CONTAINER_ID }} ...
docker logs ${{ steps.container.outputs.CONTAINER_ID }}
for container_id in $(docker ps -aqf "ancestor=opensearchproject/opensearch:${{ matrix.entry.version }}"); do \
echo Dumping logs from $container_id ... && \
docker logs $container_id \
; done
- name: Upload Test Coverage Results
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 02480e2

Please sign in to comment.