Skip to content

Commit

Permalink
Fix CosId-Jdbc integration test (Ahoo-Wang#21)
Browse files Browse the repository at this point in the history
fix Init CosId-Db for Integration Test(CI)
  • Loading branch information
Ahoo-Wang authored Jan 14, 2022
1 parent bc9dac8 commit 79bc851
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
55 changes: 27 additions & 28 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,31 +110,30 @@ jobs:
- name: Test CosId-Zookeeper
run: gradle cosid-zookeeper:clean cosid-zookeeper:check

# cosid-jdbc-test:
# name: CosId Jdbc Test
# needs: [ cosid-core-test ]
# runs-on: ubuntu-latest
# services:
# mysql:
# image: mysql
# ports:
# - 3306:3306
# env:
# MYSQL_ROOT_PASSWORD: root
# steps:
# - name: Checkout
# uses: actions/checkout@master
#
# - name: Set up JDK 8
# uses: actions/setup-java@v2
# with:
# java-version: '8'
# distribution: 'adopt'
# server-id: github
# settings-path: ${{ github.workspace }}
#
# - name: Init CosId-Db
# run: mysql -h 127.0.0.1 -uroot -p $MYSQL_ROOT_PASSWORD < cosid-jdbc/src/main/init-script/init-cosid-mysql.sql
#
# - name: Test CosId-Jdbc
# run: gradle cosid-jdbc:clean cosid-jdbc:check
# https://github.com/actions/virtual-environments/issues/375
# https://github.blog/changelog/2020-02-21-github-actions-breaking-change-ubuntu-virtual-environments-will-no-longer-start-the-mysql-service-automatically/
cosid-jdbc-test:
name: CosId Jdbc Test
needs: [ cosid-core-test ]
runs-on: ubuntu-latest
steps:
- name: Start Mysql
run: sudo /etc/init.d/mysql start

- name: Checkout
uses: actions/checkout@master

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
server-id: github
settings-path: ${{ github.workspace }}

- name: Init CosId-Db
run: mysql -vvv -h localhost -uroot -proot < cosid-jdbc/src/main/init-script/init-cosid-mysql.sql

- name: Test CosId-Jdbc
run: gradle cosid-jdbc:clean cosid-jdbc:check

4 changes: 2 additions & 2 deletions cosid-jdbc/src/main/init-script/init-cosid-mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ create table if not exists cosid_machine
primary key (name)
) engine = InnoDB;

create index if not exists idx_namespace on cosid_machine (namespace);
create index if not exists idx_instance_id on cosid_machine (instance_id);
create index idx_namespace on cosid_machine (namespace);
create index idx_instance_id on cosid_machine (instance_id);



0 comments on commit 79bc851

Please sign in to comment.