|
87 | 87 | MARIADB_DATABASE: vendure |
88 | 88 | MARIADB_USER: vendure |
89 | 89 | MARIADB_PASSWORD: password |
| 90 | + # Ensure InnoDB is used for locking support |
| 91 | + MARIADB_MYSQL_LOCALHOST_USER: 1 |
| 92 | + MARIADB_INITDB_SKIP_TZINFO: 1 |
90 | 93 | ports: |
91 | 94 | - 3306 |
92 | | - options: --health-cmd="mariadb-admin ping -h localhost -u vendure -ppassword" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 95 | + options: --health-cmd="mariadb-admin ping -h localhost -u vendure -ppassword" --health-interval=10s --health-timeout=5s --health-retries=3 --command="mysqld --innodb_file_per_table=1 --default-storage-engine=InnoDB" |
93 | 96 | mysql: |
94 | 97 | image: vendure/mysql-8-native-auth:latest |
95 | 98 | env: |
@@ -146,39 +149,49 @@ jobs: |
146 | 149 | - name: Build |
147 | 150 | run: npx lerna run ci |
148 | 151 | - name: Wait for services to be ready |
| 152 | + env: |
| 153 | + E2E_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }} |
| 154 | + E2E_MARIADB_PORT: ${{ job.services.mariadb.ports['3306'] }} |
| 155 | + E2E_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }} |
| 156 | + E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }} |
| 157 | + E2E_REDIS_PORT: ${{ job.services.redis.ports['6379'] }} |
| 158 | + DB: ${{ matrix.db }} |
149 | 159 | run: | |
150 | 160 | echo "Waiting for required services..." |
151 | 161 | # Wait for redis |
152 | | - for i in {1..60}; do |
153 | | - if nc -z localhost $E2E_REDIS_PORT; then break; fi |
| 162 | + for i in {1..30}; do |
| 163 | + if nc -z localhost $E2E_REDIS_PORT; then echo "Redis Ready"; break; fi |
| 164 | + if [ $i -eq 30 ]; then echo "Redis Timeout"; exit 1; fi |
154 | 165 | sleep 1 |
155 | 166 | done |
156 | 167 |
|
157 | 168 | # Wait for DB ports depending on matrix value |
158 | 169 | if [ "$DB" = "postgres" ]; then |
159 | | - for i in {1..60}; do |
160 | | - if nc -z localhost $E2E_POSTGRES_PORT; then break; fi |
| 170 | + for i in {1..30}; do |
| 171 | + if nc -z localhost $E2E_POSTGRES_PORT; then echo "Postgres Ready"; break; fi |
| 172 | + if [ $i -eq 30 ]; then echo "Postgres Timeout"; exit 1; fi |
161 | 173 | sleep 1 |
162 | 174 | done |
163 | 175 | elif [ "$DB" = "mariadb" ]; then |
164 | | - for i in {1..60}; do |
165 | | - if nc -z localhost $E2E_MARIADB_PORT; then break; fi |
| 176 | + for i in {1..30}; do |
| 177 | + if nc -z localhost $E2E_MARIADB_PORT; then echo "MariaDB Ready"; break; fi |
| 178 | + if [ $i -eq 30 ]; then echo "MariaDB Timeout"; exit 1; fi |
166 | 179 | sleep 1 |
167 | 180 | done |
168 | 181 | elif [ "$DB" = "mysql" ]; then |
169 | | - for i in {1..60}; do |
170 | | - if nc -z localhost $E2E_MYSQL_PORT; then break; fi |
| 182 | + for i in {1..30}; do |
| 183 | + if nc -z localhost $E2E_MYSQL_PORT; then echo "MySQL Ready"; break; fi |
| 184 | + if [ $i -eq 30 ]; then echo "MySQL Timeout"; exit 1; fi |
171 | 185 | sleep 1 |
172 | 186 | done |
173 | 187 | fi |
174 | 188 |
|
175 | 189 | # Wait for Elasticsearch |
176 | | - for i in {1..60}; do |
177 | | - if curl --silent --fail http://localhost:$E2E_ELASTIC_PORT/_cluster/health >/dev/null 2>&1; then break; fi |
| 190 | + for i in {1..30}; do |
| 191 | + if curl --silent --fail http://localhost:$E2E_ELASTIC_PORT/_cluster/health >/dev/null 2>&1; then echo "Elasticsearch Ready"; break; fi |
| 192 | + if [ $i -eq 30 ]; then echo "Elasticsearch Timeout"; exit 1; fi |
178 | 193 | sleep 1 |
179 | 194 | done |
180 | | -
|
181 | | - echo "Services appear reachable." |
182 | 195 | - name: e2e tests |
183 | 196 | env: |
184 | 197 | E2E_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }} |
|
0 commit comments