Skip to content

Commit

Permalink
Update docker-compose and gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatas1n committed Sep 20, 2022
1 parent e44e456 commit 423eaff
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 28 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Farol Verde Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
Cypress:
runs-on: ubuntu-latest
steps:
- name: Checkout repository content
uses: actions/checkout@v2
- name: Run Project containers
run: docker-compose up -d
- name: Run Migrate
run: docker exec farol_verde_server /bin/bash -c "python manage.py migrate"
- name: Run Cypress
run: docker exec farol_verde_tests /bin/bash -c "cd /tests && cypress run"

Pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout repository content
uses: actions/checkout@v2
- name: Run Project containers
run: docker-compose up -d
- name: Run Pytest
run: docker exec farolwagtail /bin/bash -c "pytest ."

Black:
runs-on: ubuntu-latest
steps:
- name: Checkout repository content
uses: actions/checkout@v2
- name: Run Project containers
run: docker-compose up -d
- name: Run Black Check
run: docker exec farolwagtail /bin/bash -c "black --check ."
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ __pycache__/
*.pyc
.vscode*
landing/static
/tests/cypress/videos
/tests/cypress/screenshots
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
SERVER_CONTAINER=farol_verde_server
SERVER_CONTAINER=farolwagtail
TEST_CONTAINER=faroltests

attach:
docker exec -it $(SERVER_CONTAINER) bash

test-attach:
docker exec -it $(TEST_CONTAINER) bash

up:
docker-compose up

Expand All @@ -12,6 +16,9 @@ stop:
rm:
docker-compose rm

test:
docker exec $(TEST_CONTAINER) /bin/bash -c "cd /tests && cypress run"

createsu:
docker exec -it $(SERVER_CONTAINER) poetry run python manage.py createsuperuser

Expand Down
14 changes: 12 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.3"

services:

farol_verde_server:
server:
environment:
- PYTHONUNBUFFERED=1
env_file:
Expand All @@ -15,7 +15,7 @@ services:
- ./landing:/landing
- farol_verde:/tmp/farol_verde_db
- media:/landing/media
container_name: farol_verde_server
container_name: farolwagtail
depends_on:
- farol_verde_db
entrypoint: ["/bin/bash", "run.sh"]
Expand All @@ -38,6 +38,16 @@ services:
ports:
- "5656:5656"

tests:
image: cypress/included:10.7.0
container_name: faroltests
working_dir: /tests
volumes:
- ./tests:/tests
depends_on:
- server
entrypoint: ["tail", "-f", "/dev/null"]

volumes:
farol_verde:
media:
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
e2e: {
baseUrl: 'http://localhost:4000',
baseUrl: 'http://farolwagtail:8000',
setupNodeEvents(on, config) {
// implement node event listeners here
},
Expand Down
24 changes: 0 additions & 24 deletions tests/cypress/e2e/candidates/party.cy.js

This file was deleted.

0 comments on commit 423eaff

Please sign in to comment.