Run blackbox tests in parallel (#16048)

* Run blackbox tests in parallel

* Add slight delay for updates in timezone tests

* Revert trigger on PR
This commit is contained in:
ian
2022-10-19 21:04:32 +07:00
committed by GitHub
parent 13f4ec027d
commit 83b6027cc3
5 changed files with 27 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ runs:
with:
node-version: 16
- uses: pnpm/action-setup@v2.2.2
- uses: pnpm/action-setup@v2.2.4
name: Install pnpm
id: pnpm-install
with:

View File

@@ -21,8 +21,20 @@ env:
jobs:
test:
name: All Databases
name: ${{ matrix.vendor }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
vendor:
- sqlite3
- postgres
- postgres10
- mysql
- maria
- mssql
- oracle
- cockroachdb
steps:
- name: Checkout repository
uses: actions/checkout@v3
@@ -31,6 +43,7 @@ jobs:
uses: ./.github/actions/prepare
- name: Install Oracle client
if: matrix.vendor == 'oracle'
run: |
sudo apt update -y && sudo apt install -y alien libaio1 && \
wget https://download.oracle.com/otn_software/linux/instantclient/214000/$ORACLE_DL && \
@@ -40,7 +53,8 @@ jobs:
ORACLE_DL: oracle-instantclient-basic-21.4.0.0.0-1.el8.x86_64.rpm
- name: Start Databases
run: docker compose -f tests-blackbox/docker-compose.yml up -d --quiet-pull --wait
if: matrix.vendor != 'sqlite3'
run: docker compose -f tests-blackbox/docker-compose.yml up ${{ matrix.vendor }} -d --quiet-pull --wait
- name: Run Tests
run: pnpm run -w test:blackbox
run: TEST_DB=${{ matrix.vendor }} pnpm run -w test:blackbox

View File

@@ -7,6 +7,7 @@ import { spawn, ChildProcess } from 'child_process';
import { awaitDirectusConnection } from '@utils/await-connection';
import { validateDateDifference } from '@utils/validate-date-difference';
import * as common from '@common/index';
import { sleep } from '@utils/sleep';
const collectionName = 'schema_timezone_tests';
@@ -237,6 +238,8 @@ describe('schema', () => {
describe('stores the correct timezone data when updated', () => {
it.each(vendors)('%s', async (vendor) => {
await sleep(1000);
const payload = {
date: sampleDates[0]!.date,
};

View File

@@ -7,6 +7,7 @@ import { spawn, ChildProcess } from 'child_process';
import { awaitDirectusConnection } from '@utils/await-connection';
import { validateDateDifference } from '@utils/validate-date-difference';
import * as common from '@common/index';
import { sleep } from '@utils/sleep';
const collectionName = 'schema_timezone_tests';
@@ -294,6 +295,8 @@ describe('schema', () => {
describe('stores the correct timezone data when updated', () => {
it.each(vendors)('%s', async (vendor) => {
await sleep(1000);
const payload = {
date: sampleDates[0]!.date,
};

View File

@@ -5,6 +5,7 @@ import { cloneDeep } from 'lodash';
import { validateDateDifference } from '@utils/validate-date-difference';
import { CreateCollection, CreateField, DeleteCollection } from '@common/functions';
import * as common from '@common/index';
import { sleep } from '@utils/sleep';
const collectionName = 'schema_timezone_tests';
@@ -255,6 +256,8 @@ describe('schema', () => {
describe('stores the correct timezone data when updated', () => {
it.each(vendors)('%s', async (vendor) => {
await sleep(1000);
const payload = {
date: sampleDates[0]!.date,
};