mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-02-10 18:05:07 +08:00
[git actions] Dameng tests action, dameng connector refactoring, dependencies update, minor structure refactorng
This commit is contained in:
49
.github/workflows/damengDatabaseTests.yml
vendored
Normal file
49
.github/workflows/damengDatabaseTests.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: Dameng database tests
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'DocService/sources/databaseConnectors/baseConnector.js'
|
||||
- 'DocService/sources/databaseConnectors/damengConnector.js'
|
||||
jobs:
|
||||
dameng-tests:
|
||||
name: Dameng
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run dameng DB docker container
|
||||
run: docker run --name dameng -p 5236:5236 -e PAGE_SIZE=16 -e LD_LIBRARY_PATH=/opt/dmdbms/bin -e INSTANCE_NAME=dm8_01 -d danilaworker/damengdb:8.1.2
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Caching dependencies
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
./npm-shrinkwrap.json
|
||||
./Common/npm-shrinkwrap.json
|
||||
./DocService/npm-shrinkwrap.json
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
npm --prefix Common ci
|
||||
npm --prefix DocService ci
|
||||
|
||||
- name: Await database service to finish startup
|
||||
run: sleep 15
|
||||
|
||||
- name: Creating service DB configuration
|
||||
run: |
|
||||
echo '{"services": {"CoAuthoring": {"sql": {"type": "dameng", "dbHost": "127.0.0.1", "dbPort": 5236, "dbUser": "SYSDBA", "dbPass": "SYSDBA001"}}}}' >> Common/config/local.json
|
||||
|
||||
- name: Creating schema
|
||||
run: |
|
||||
docker cp ./.github/workflows/scripts/damengStartup.sh dameng:/
|
||||
docker exec dameng chmod 667 /damengStartup.sh
|
||||
docker exec dameng /damengStartup.sh
|
||||
|
||||
- name: Run Jest
|
||||
run: npm exec -c 'cd ./DocService && jest databaseTests --inject-globals=false --config=../tests/jest.config.js'
|
||||
127
.github/workflows/databasesTestsWorkflow.yml
vendored
127
.github/workflows/databasesTestsWorkflow.yml
vendored
@ -1,127 +0,0 @@
|
||||
name: Integration databases tests
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'DocService/sources/**Connector.js'
|
||||
jobs:
|
||||
oracle-tests:
|
||||
name: Oracle database tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run Oracle DB docker container
|
||||
run: docker run --name oracle -p 8080:1521 -p 8081:5500 -e ORACLE_PASSWORD=admin -e APP_USER=onlyoffice -e APP_USER_PASSWORD=onlyoffice -d gvenzl/oracle-xe:21-slim
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
npm --prefix Common ci
|
||||
npm --prefix DocService ci
|
||||
|
||||
- name: Creating service DB configuration
|
||||
run: |
|
||||
echo '{"services": {"CoAuthoring": {"sql": {"type": "oracle", "dbHost": "127.0.0.1", "dbPort": "8080", "dbUser": "onlyoffice", "dbPass": "onlyoffice", "dbName": "xepdb1"}}}}' >> Common/config/local.json
|
||||
|
||||
- name: Await database service to finish startup
|
||||
run: sleep 15
|
||||
|
||||
- name: Creating schema
|
||||
run: |
|
||||
docker cp ./schema/oracle/createdb.sql oracle:/
|
||||
docker exec oracle sqlplus -s onlyoffice/onlyoffice@//localhost/xepdb1 @/createdb.sql
|
||||
|
||||
- name: Run Jest
|
||||
run: npm exec -c 'cd ./DocService && jest databaseTests --inject-globals=false --config=../tests/jest.config.js'
|
||||
|
||||
mssql-tests:
|
||||
name: MSSQL database tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run MSSQL DB docker container
|
||||
run: docker run --name mssql -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=onlYoff1ce" -p 8080:1433 -d mcr.microsoft.com/mssql/server:2022-latest
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
npm --prefix Common ci
|
||||
npm --prefix DocService ci
|
||||
|
||||
- name: Creating service DB configuration
|
||||
run: |
|
||||
echo '{"services": {"CoAuthoring": {"sql": {"type": "mssql", "dbHost": "localhost", "dbPort": 8080, "dbUser": "sa", "dbPass": "onlYoff1ce"}}}}' >> Common/config/local.json
|
||||
|
||||
- name: Await database service to finish startup
|
||||
run: sleep 5
|
||||
|
||||
- name: Creating schema
|
||||
run: |
|
||||
docker cp ./schema/mssql/createdb.sql mssql:/
|
||||
docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P onlYoff1ce -i /createdb.sql
|
||||
|
||||
- name: Run Jest
|
||||
run: npm exec -c 'cd ./DocService && jest databaseTests --inject-globals=false --config=../tests/jest.config.js'
|
||||
|
||||
mysql-tests:
|
||||
name: MYSQL database tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run Mysql DB docker container
|
||||
run: docker run --name mysql -p 8080:3306 -p 8081:33060 -e MYSQL_HOST=127.0.0.1 -e MYSQL_ROOT_PASSWORD=onlyoffice -e MYSQL_DATABASE=onlyoffice -d mysql:latest
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
npm --prefix Common ci
|
||||
npm --prefix DocService ci
|
||||
|
||||
- name: Creating service DB configuration
|
||||
run: |
|
||||
echo '{"services": {"CoAuthoring": {"sql": {"type": "mysql", "dbHost": "127.0.0.1", "dbPort": "8080", "dbUser": "root", "dbPass": "onlyoffice"}}}}' >> Common/config/local.json
|
||||
|
||||
- name : Creating schema
|
||||
run: |
|
||||
docker cp ./schema/mysql/createdb.sql mysql:/
|
||||
docker exec mysql mysql -h 127.0.0.1 -u root --password=onlyoffice -D onlyoffice -e 'source /createdb.sql'
|
||||
|
||||
- name: Run Jest
|
||||
run: npm exec -c 'cd ./DocService && jest databaseTests --inject-globals=false --config=../tests/jest.config.js'
|
||||
|
||||
postgres-tests:
|
||||
name: Postgres database tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run Postgres DB docker container
|
||||
run: docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=onlyoffice -e POSTGRES_USER=onlyoffice -e POSTGRES_DB=onlyoffice -d postgres:latest
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
npm --prefix Common ci
|
||||
npm --prefix DocService ci
|
||||
|
||||
- name: Creating service DB configuration
|
||||
run: |
|
||||
echo '{"services": {"CoAuthoring": {"sql": {"dbHost": "127.0.0.1"}}}}' >> Common/config/local.json
|
||||
|
||||
- name : Creating schema
|
||||
run: |
|
||||
docker cp ./schema/postgresql/createdb.sql postgres:/
|
||||
docker exec postgres psql -d onlyoffice -U onlyoffice -a -f /createdb.sql
|
||||
|
||||
- name: Run Jest
|
||||
run: npm exec -c 'cd ./DocService && jest databaseTests --inject-globals=false --config=../tests/jest.config.js'
|
||||
48
.github/workflows/mssqlDatabaseTests.yml
vendored
Normal file
48
.github/workflows/mssqlDatabaseTests.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: MSSQL database tests
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'DocService/sources/databaseConnectors/baseConnector.js'
|
||||
- 'DocService/sources/databaseConnectors/mssqlConnector.js'
|
||||
jobs:
|
||||
mssql-tests:
|
||||
name: MSSQL
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run MSSQL DB docker container
|
||||
run: docker run --name mssql -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=onlYoff1ce" -p 8080:1433 -d mcr.microsoft.com/mssql/server:2022-latest
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Caching dependencies
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
./npm-shrinkwrap.json
|
||||
./Common/npm-shrinkwrap.json
|
||||
./DocService/npm-shrinkwrap.json
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
npm --prefix Common ci
|
||||
npm --prefix DocService ci
|
||||
|
||||
- name: Creating service DB configuration
|
||||
run: |
|
||||
echo '{"services": {"CoAuthoring": {"sql": {"type": "mssql", "dbHost": "localhost", "dbPort": 8080, "dbUser": "sa", "dbPass": "onlYoff1ce"}}}}' >> Common/config/local.json
|
||||
|
||||
- name: Await database service to finish startup
|
||||
run: sleep 5
|
||||
|
||||
- name: Creating schema
|
||||
run: |
|
||||
docker cp ./schema/mssql/createdb.sql mssql:/
|
||||
docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P onlYoff1ce -i /createdb.sql
|
||||
|
||||
- name: Run Jest
|
||||
run: npm exec -c 'cd ./DocService && jest databaseTests --inject-globals=false --config=../tests/jest.config.js'
|
||||
45
.github/workflows/mysqlDatabaseTests.yml
vendored
Normal file
45
.github/workflows/mysqlDatabaseTests.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
name: MYSQL database tests
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'DocService/sources/databaseConnectors/baseConnector.js'
|
||||
- 'DocService/sources/databaseConnectors/mysqlConnector.js'
|
||||
jobs:
|
||||
mysql-tests:
|
||||
name: MYSQL
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run Mysql DB docker container
|
||||
run: docker run --name mysql -p 8080:3306 -p 8081:33060 -e MYSQL_HOST=127.0.0.1 -e MYSQL_ROOT_PASSWORD=onlyoffice -e MYSQL_DATABASE=onlyoffice -d mysql:latest
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Caching dependencies
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
./npm-shrinkwrap.json
|
||||
./Common/npm-shrinkwrap.json
|
||||
./DocService/npm-shrinkwrap.json
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
npm --prefix Common ci
|
||||
npm --prefix DocService ci
|
||||
|
||||
- name: Creating service DB configuration
|
||||
run: |
|
||||
echo '{"services": {"CoAuthoring": {"sql": {"type": "mysql", "dbHost": "127.0.0.1", "dbPort": "8080", "dbUser": "root", "dbPass": "onlyoffice"}}}}' >> Common/config/local.json
|
||||
|
||||
- name : Creating schema
|
||||
run: |
|
||||
docker cp ./schema/mysql/createdb.sql mysql:/
|
||||
docker exec mysql mysql -h 127.0.0.1 -u root --password=onlyoffice -D onlyoffice -e 'source /createdb.sql'
|
||||
|
||||
- name: Run Jest
|
||||
run: npm exec -c 'cd ./DocService && jest databaseTests --inject-globals=false --config=../tests/jest.config.js'
|
||||
48
.github/workflows/oracleDatabaseTests.yml
vendored
Normal file
48
.github/workflows/oracleDatabaseTests.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: Oracle database tests
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'DocService/sources/databaseConnectors/baseConnector.js'
|
||||
- 'DocService/sources/databaseConnectors/oracleConnector.js'
|
||||
jobs:
|
||||
oracle-tests:
|
||||
name: Oracle
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run Oracle DB docker container
|
||||
run: docker run --name oracle -p 8080:1521 -p 8081:5500 -e ORACLE_PASSWORD=admin -e APP_USER=onlyoffice -e APP_USER_PASSWORD=onlyoffice -d gvenzl/oracle-xe:21-slim
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Caching dependencies
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
./npm-shrinkwrap.json
|
||||
./Common/npm-shrinkwrap.json
|
||||
./DocService/npm-shrinkwrap.json
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
npm --prefix Common ci
|
||||
npm --prefix DocService ci
|
||||
|
||||
- name: Creating service DB configuration
|
||||
run: |
|
||||
echo '{"services": {"CoAuthoring": {"sql": {"type": "oracle", "dbHost": "127.0.0.1", "dbPort": "8080", "dbUser": "onlyoffice", "dbPass": "onlyoffice", "dbName": "xepdb1"}}}}' >> Common/config/local.json
|
||||
|
||||
- name: Await database service to finish startup
|
||||
run: sleep 15
|
||||
|
||||
- name: Creating schema
|
||||
run: |
|
||||
docker cp ./schema/oracle/createdb.sql oracle:/
|
||||
docker exec oracle sqlplus -s onlyoffice/onlyoffice@//localhost/xepdb1 @/createdb.sql
|
||||
|
||||
- name: Run Jest
|
||||
run: npm exec -c 'cd ./DocService && jest databaseTests --inject-globals=false --config=../tests/jest.config.js'
|
||||
45
.github/workflows/postgreDatabaseTests.yml
vendored
Normal file
45
.github/workflows/postgreDatabaseTests.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
name: Postgre database tests
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'DocService/sources/databaseConnectors/baseConnector.js'
|
||||
- 'DocService/sources/databaseConnectors/postgreConnector.js'
|
||||
jobs:
|
||||
postgres-tests:
|
||||
name: Postgres
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run Postgres DB docker container
|
||||
run: docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=onlyoffice -e POSTGRES_USER=onlyoffice -e POSTGRES_DB=onlyoffice -d postgres:latest
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Caching dependencies
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
./npm-shrinkwrap.json
|
||||
./Common/npm-shrinkwrap.json
|
||||
./DocService/npm-shrinkwrap.json
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
npm --prefix Common ci
|
||||
npm --prefix DocService ci
|
||||
|
||||
- name: Creating service DB configuration
|
||||
run: |
|
||||
echo '{"services": {"CoAuthoring": {"sql": {"dbHost": "127.0.0.1"}}}}' >> Common/config/local.json
|
||||
|
||||
- name: Creating schema
|
||||
run: |
|
||||
docker cp ./schema/postgresql/createdb.sql postgres:/
|
||||
docker exec postgres psql -d onlyoffice -U onlyoffice -a -f /createdb.sql
|
||||
|
||||
- name: Run Jest
|
||||
run: npm exec -c 'cd ./DocService && jest databaseTests --inject-globals=false --config=../tests/jest.config.js'
|
||||
33
.github/workflows/scripts/damengStartup.sh
vendored
Normal file
33
.github/workflows/scripts/damengStartup.sh
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# create user "onlyoffice" identified by "onlyoffice" password_policy 0;
|
||||
/opt/dmdbms/bin/disql SYSDBA/SYSDBA001:5236 <<EOF
|
||||
CREATE TABLE doc_changes
|
||||
(
|
||||
tenant varchar(255) NOT NULL,
|
||||
id varchar(255) NOT NULL,
|
||||
change_id int NOT NULL,
|
||||
user_id varchar(255) NOT NULL,
|
||||
user_id_original varchar(255) NOT NULL,
|
||||
user_name varchar(255) NOT NULL,
|
||||
change_data text NOT NULL,
|
||||
change_date TIMESTAMP(6) NOT NULL,
|
||||
PRIMARY KEY (tenant, id, change_id)
|
||||
);
|
||||
CREATE TABLE task_result
|
||||
(
|
||||
tenant varchar(255) NOT NULL,
|
||||
id varchar(255) NOT NULL,
|
||||
status int NOT NULL,
|
||||
status_info int NOT NULL,
|
||||
created_at TIMESTAMP(6) DEFAULT NOW(),
|
||||
last_open_date TIMESTAMP(6) NOT NULL,
|
||||
user_index int NOT NULL DEFAULT 1,
|
||||
change_id int NOT NULL DEFAULT 0,
|
||||
callback text NOT NULL,
|
||||
baseurl text NOT NULL,
|
||||
password text NULL,
|
||||
additional text NULL,
|
||||
PRIMARY KEY (tenant, id)
|
||||
);
|
||||
exit;
|
||||
EOF
|
||||
@ -4,7 +4,7 @@ on:
|
||||
paths:
|
||||
- '**.js'
|
||||
- '!tests/integration/**'
|
||||
- '!DocService/sources/**Connector.js'
|
||||
- '!DocService/sources/databaseConnectors/**'
|
||||
jobs:
|
||||
unit-tests:
|
||||
name: Service unit tests
|
||||
@ -14,6 +14,16 @@ jobs:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Caching dependencies
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
./npm-shrinkwrap.json
|
||||
./Common/npm-shrinkwrap.json
|
||||
./DocService/npm-shrinkwrap.json
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
npm ci
|
||||
Reference in New Issue
Block a user