Skip to content

Commit

Permalink
feat(makefile): test on k8s command
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamad-liyaghi committed Jul 26, 2024
1 parent 9cc6530 commit 7d764e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/test-kubernetes/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ runs:
shell: bash

- name: Run Backend Tests
run: kubectl exec -it $(kubectl get pods | grep backend | awk '{print $1}') -- pytest
run: make test_k8s
shell: bash
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help build run stop test admin local_confmap prod_confmap
.PHONY: help build run stop test test_k8s admin local_confmap prod_confmap

help:
@echo "Available targets:"
Expand All @@ -8,6 +8,7 @@ help:
@echo " deploy - Deploy the docker container."
@echo " stop - Stop the docker container."
@echo " test - Run the tests."
@echo " test_k8s - Run the tests in Kubernetes."
@echo " migrations - Create migrations."
@echo " migrate - Migrate"
@echo " local_confmap - Make Kubernetes config maps for local stage"
Expand All @@ -32,6 +33,9 @@ stop:
test:
docker exec academy-master-backend pytest

test_k8s:
kubectl exec -it $(kubectl get pods | grep backend | awk '{print $1}') -- pytest

migrations:
docker exec academy-master-backend python manage.py makemigrations

Expand Down

0 comments on commit 7d764e2

Please sign in to comment.