-
Notifications
You must be signed in to change notification settings - Fork 61
149 lines (129 loc) · 8.33 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create Docker Compose configuration file
run: |
echo "POSTGRES_DB=mobydq" >> ./.env
echo "POSTGRES_USER=postgres" >> ./.env
echo "POSTGRES_PASSWORD=change_me" >> ./.env
echo "GRAPHQL_DATABASE_URL=postgres://postgres:change_me@db:5432/mobydq" >> ./.env
echo "GRAPHQL_PORT=5433" >> ./.env
echo "GRAPHQL_SECRET_KEY=change_me" >> ./.env
echo "MAIL_HOST=smtp.server.org" >> ./.env
echo "MAIL_PORT=25" >> ./.env
echo "MAIL_SENDER=change_me@change_me.com" >> ./.env
echo "MAIL_PASSWORD=change_me" >> ./.env
echo "MAIL_BASE_URL=https://localhost" >> ./.env
- name: Build application Docker images
run: docker-compose -f docker-compose.yml build db graphql scripts
- name: Run application Docker containers
run: docker-compose -f docker-compose.yml up -d db graphql
- name: List Docker containers
run: docker ps -a
#db-cloudera, db-sql-server
- name: Build test Docker images
run: >-
docker-compose -f docker-compose.yml -f docker-compose.test.yml build
db-mariadb
db-mysql
db-postgresql
test-scripts
test-lint-python
- name: List Docker images
run: docker images
- name: Run Docker containers to test database functions
run: |
export TEST_CASE=test_db.TestDb
export TEST_HOST=
export TEST_PORT=
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
- name: Run Docker containers to test batch methods
run: |
export TEST_CASE=test_scripts.test_batch
export TEST_HOST=
export TEST_PORT=
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
- name: Run Docker containers to test data source methods
run: |
export TEST_CASE=test_scripts.test_data_source.TestDataSource.test_get_password
export TEST_HOST=
export TEST_PORT=
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
#- name: Run Docker containers to test data source connectivity to Cloudera Hive
# run: |
# export TEST_CASE=test_scripts.test_data_source.TestDataSource.test_get_connection_cloudera_hive
# export TEST_HOST=db-cloudera
# export TEST_PORT=10000
# docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d $TEST_HOST
# docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
# docker-compose -f docker-compose.yml -f docker-compose.test.yml stop $TEST_HOST
# docker-compose -f docker-compose.yml -f docker-compose.test.yml rm -f $TEST_HOST
- name: Run Docker containers to test data source connectivity to MariaDB
run: |
export TEST_CASE=test_scripts.test_data_source.TestDataSource.test_get_connection_mariadb
export TEST_HOST=db-mariadb
export TEST_PORT=3306
docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d $TEST_HOST
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
docker-compose -f docker-compose.yml -f docker-compose.test.yml stop $TEST_HOST
docker-compose -f docker-compose.yml -f docker-compose.test.yml rm -f $TEST_HOST
- name: Run Docker containers to test data source connectivity to MySQL
run: |
export TEST_CASE=test_scripts.test_data_source.TestDataSource.test_get_connection_mysql
export TEST_HOST=db-mysql
export TEST_PORT=3306
docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d $TEST_HOST
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
docker-compose -f docker-compose.yml -f docker-compose.test.yml stop $TEST_HOST
docker-compose -f docker-compose.yml -f docker-compose.test.yml rm -f $TEST_HOST
- name: Run Docker containers to test data source connectivity to PostgreSQL
run: |
export TEST_CASE=test_scripts.test_data_source.TestDataSource.test_get_connection_postgresql
export TEST_HOST=db-postgresql
export TEST_PORT=5432
docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d $TEST_HOST
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
docker-compose -f docker-compose.yml -f docker-compose.test.yml stop $TEST_HOST
docker-compose -f docker-compose.yml -f docker-compose.test.yml rm -f $TEST_HOST
- name: Run Docker containers to test data source connectivity to SQLite
run: |
export TEST_CASE=test_scripts.test_data_source.TestDataSource.test_get_connection_sqlite
export TEST_HOST=
export TEST_PORT=
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
#- name: Run Docker containers to test data source connectivity to SQL Server
# run: |
# export TEST_CASE=test_scripts.test_data_source.TestDataSource.test_get_connection_sql_server
# export TEST_HOST=db-sql-server
# export TEST_PORT=1433
# docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d $TEST_HOST
# docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
# docker-compose -f docker-compose.yml -f docker-compose.test.yml stop $TEST_HOST
# docker-compose -f docker-compose.yml -f docker-compose.test.yml rm -f $TEST_HOST
- name: Run Docker containers to test indicator methods
run: |
export TEST_CASE=test_scripts.test_indicator
export TEST_HOST=db-postgresql
export TEST_PORT=5432
docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d $TEST_HOST
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
docker-compose -f docker-compose.yml -f docker-compose.test.yml stop $TEST_HOST
docker-compose -f docker-compose.yml -f docker-compose.test.yml rm -f $TEST_HOST
- name: Run Docker containers to test session methods
run: |
export TEST_CASE=test_scripts.test_session
export TEST_HOST=
export TEST_PORT=
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
- name: Run Docker containers to test utility methods
run: |
export TEST_CASE=test_scripts.test_utils
export TEST_HOST=
export TEST_PORT=
docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-scripts test-scripts
#- name: Run python linter
# run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --exit-code-from test-lint-python test-lint-python