Skip to content

Commit

Permalink
chore(#34): implement e2e test (#36)
Browse files Browse the repository at this point in the history
* First draft version

* Login to DockerHub

* correcting yml

* Add wait between steps

* Comment line that seems to exit with failure every time (need to confirm)

* Renaming response

* Change beforeAll and afterAll to one liner

---------

Co-authored-by: Maria Lorena Rodriguez Viruel <[email protected]>
  • Loading branch information
lorerod and Maria Lorena Rodriguez Viruel authored Jul 24, 2023
1 parent cd10db0 commit e2bafbc
Show file tree
Hide file tree
Showing 8 changed files with 7,774 additions and 1,656 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test

on: [push, pull_request]

jobs:
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
env:
POSTGRES_USER: "root"
POSTGRES_PASSWORD: "supercoolpassword"
POSTGRES_DB: "data"
POSTGRES_TABLE: "couchdb"
POSTGRES_SCHEMA: "v1"
DBT_POSTGRES_USER: "dbt_user"
DBT_POSTGRES_PASSWORD: "supercoolpassword"
DBT_POSTGRES_SCHEMA: "dbt"
DBT_POSTGRES_HOST: "postgres"
CHT_PIPELINE_BRANCH_URL: "https://github.com/medic/cht-pipeline.git#main"
COUCHDB_USER: "test"
COUCHDB_PASSWORD: "test"
COUCHDB_DBS: "couchdb couchdb_sentinel"
COUCHDB_HOST: "couchdb"
COUCHDB_PORT: 5984
COUCHDB_SECURE: false
SUPERSET_PASSWORD: "password"
SUPERSET_ADMIN_EMAIL: "[email protected]"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Get Docker Hub username
id: get-docker-hub-username
run: echo '::set-output name=dockerhub_username::${{ secrets.DOCKERHUB_USERNAME }}'
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: steps.get-docker-hub-username.outputs.dockerhub_username
- name: Install
run: npm install
- name: Run local
run: npm run local
- name: Sleep for 60 seconds
run: sleep 60s
- name: Run e2e tests
run: npm test
8 changes: 8 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
clearMocks: true,
testPathIgnorePatterns: [
'<rootDir>/dist/',
],
};
Loading

0 comments on commit e2bafbc

Please sign in to comment.