Skip to content

Commit

Permalink
test: add dry-run and publish test results
Browse files Browse the repository at this point in the history
  • Loading branch information
jordipuigbou committed Nov 16, 2023
1 parent 7a11a5e commit e3ecfa0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,18 @@ jobs:
- name: Build crud
run: make build-crud

- name: Run behave dry-run
run: make crud-tests-dry-run

- name: Run test crud
run: make run-crud-tests

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
crud/tests/_output/*.xml
- name: Clean crud
run: make clean-crud
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.venv
.vscode

**/__pycache__
**/__pycache__

**/_output
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ run-crud-tests: ## run crud tests
docker compose -f $(CRUD_DIR)/docker-compose.yml down
docker compose -f $(CRUD_DIR)/docker-compose.yml run test

.PHONY: crud-tests-dry-run
crud-tests-dry-run: ## run crud tests
docker compose -f $(CRUD_DIR)/docker-compose.yml down
docker compose -f $(CRUD_DIR)/docker-compose.yml run test bash -c "behave --dry-run"

.PHONY: run-crud-clean
clean-crud: ## build run crud
docker compose -f $(CRUD_DIR)/docker-compose.yml down
4 changes: 3 additions & 1 deletion crud/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ services:
build:
context: ./tests
dockerfile: Dockerfile
command: sh -c "sleep 5 && behave"
command: sh -c "sleep 5 && behave --junit --junit-directory /root/_output/reports"
depends_on:
- backend
- mongo
volumes:
- ./tests/_output:/root/_output

0 comments on commit e3ecfa0

Please sign in to comment.