diff --git a/.github/actions/scenarios/database-write-prohibition/mysql/action.yml b/.github/actions/scenarios/database-write-prohibition/mysql/action.yml index cfa1e44425..ba9ee18888 100644 --- a/.github/actions/scenarios/database-write-prohibition/mysql/action.yml +++ b/.github/actions/scenarios/database-write-prohibition/mysql/action.yml @@ -6,28 +6,38 @@ runs: - name: entry uses: ./.github/actions/common/entry with: - log-dir: ./logs/mq-consume-prohibition/rocketmq-one-topic + log-dir: ./logs/databse-write-prohibition/mysql - name: start mysql shell: bash run: | sudo apt-get update sudo apt-get install -y mysql-server sudo sed -i '/^\[mysqld\]/a skip-grant-tables' /etc/mysql/mysql.conf.d/mysqld.cnf + cat /etc/mysql/mysql.conf.d/mysqld.cnf sudo systemctl start mysql.service sudo systemctl status mysql.service sudo mysql -u root -p - - name: start mongodb - shell: bash - run: | - sudo apt-get install gnupg curl - curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \ - sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \ - --dearmor - echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list - sudo apt-get update - sudo apt-get install -y mongodb-org - sudo systemctl start mongod - sudo systemctl status mongod +# - name: package demos +# shell: bash +# run: | +# mvn package -Dmariadb.version=${{ matrix.mysqlClientVersion }} -DskipTests -Pmysql-test --file \ +# sermant-integration-tests/database-write-prohibition-test/pom.xml +# - name: start mysql demo +# shell: bash +# run: | +# nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \ +# -Dsermant_log_dir=${{ env.logDir }}/mysql \ +# sermant-integration-tests/database-write-prohibition-test/mariadb-demo/target/mariadb-demo.jar > ${{ env.logDir }}/mariadb.log 2>&1 & +# - name: waiting for services start +# shell: bash +# run: | +# ps -ef | grep java +# bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:9098/static/checkStatus 120 +# - name: test mysql +# shell: bash +# run: | +# mvn test -Ddatabase.write.prohibition.integration.test.type=MARIADB --file \ +# sermant-integration-tests/database-write-prohibition-test/database-write-prohibition-integration-test/pom.xml # - name: Set up root password # shell: bash # run: | @@ -38,12 +48,12 @@ runs: # if: always() # uses: ./.github/actions/common/exit # with: -# processor-keyword: rocketmq +# processor-keyword: mariadb # - name: if failure then upload error log # uses: actions/upload-artifact@v3 # if: ${{ failure() || cancelled() }} # with: -# name: (${{ github.job }})-mq-consume-prohibition-rocketmq-one-topic-(${{ matrix.rocketMqVersion }}-logs +# name: (${{ github.job }})-database-write-prohibition-mariadb-(${{ matrix.mysqlClientVersion }}-logs # path: | # ./*.log # ./logs/** diff --git a/.github/workflows/database_write_prohibition_integration_test.yml b/.github/workflows/database_write_prohibition_integration_test.yml index e7059dbefa..a8f22b4393 100644 --- a/.github/workflows/database_write_prohibition_integration_test.yml +++ b/.github/workflows/database_write_prohibition_integration_test.yml @@ -77,51 +77,24 @@ jobs: sed -i '/sermant-integration-tests/d' pom.xml sed -i '/sermant-injector/d' pom.xml mvn package -DskipTests -Ptest --file pom.xml - test-for-database-write-prohibition-mongodb: - name: Test for database-write-prohibition mongodb - runs-on: ubuntu-latest - needs: [build-agent-and-cache, download-midwares-and-cache] - strategy: - matrix: - include: - - mongodbClientVersion: "3.7.0" - - mongodbClientVersion: "3.9.1" - - mongodbClientVersion: "3.10.2" - - mongodbClientVersion: "3.11.3" - - mongodbClientVersion: "3.12.14" - - mongodbClientVersion: "4.0.6" - - mongodbClientVersion: "4.2.3" - - mongodbClientVersion: "4.5.1" - - mongodbClientVersion: "4.7.2" - - mongodbClientVersion: "4.9.1" - - mongodbClientVersion: "4.11.1" - fail-fast: false - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 100 - - name: set java version to environment - run: | - echo "javaVersion=8" >> $GITHUB_ENV - - name: common operations - uses: ./.github/actions/common/database-write-prohibition - - name: database-write-prohibition-mongodb test for mongodbClientVersion=${{ matrix.mongodbClientVersion }} - uses: ./.github/actions/scenarios/database-write-prohibition/mongodb -# test-for-database-write-prohibition-mysql: -# name: Test for database-write-prohibition mysql +# test-for-database-write-prohibition-mongodb: +# name: Test for database-write-prohibition mongodb # runs-on: ubuntu-latest # needs: [build-agent-and-cache, download-midwares-and-cache] # strategy: # matrix: # include: -# - mysqlClientVersion: "2.6.2" -# - mysqlClientVersion: "2.7.6" -# - mysqlClientVersion: "2.7.12" -# - mysqlClientVersion: "3.0.6" -# - mysqlClientVersion: "3.0.11" -# - mysqlClientVersion: "3.1.4" -# - mysqlClientVersion: "3.2.0" -# - mysqlClientVersion: "3.3.3" +# - mongodbClientVersion: "3.7.0" +# - mongodbClientVersion: "3.9.1" +# - mongodbClientVersion: "3.10.2" +# - mongodbClientVersion: "3.11.3" +# - mongodbClientVersion: "3.12.14" +# - mongodbClientVersion: "4.0.6" +# - mongodbClientVersion: "4.2.3" +# - mongodbClientVersion: "4.5.1" +# - mongodbClientVersion: "4.7.2" +# - mongodbClientVersion: "4.9.1" +# - mongodbClientVersion: "4.11.1" # fail-fast: false # steps: # - uses: actions/checkout@v3 @@ -132,5 +105,32 @@ jobs: # echo "javaVersion=8" >> $GITHUB_ENV # - name: common operations # uses: ./.github/actions/common/database-write-prohibition -# - name: database-write-prohibition-mysql test for mysqlVersion=${{ matrix.mysqlVersion }} -# uses: ./.github/actions/scenarios/database-write-prohibition/mysql \ No newline at end of file +# - name: database-write-prohibition-mongodb test for mongodbClientVersion=${{ matrix.mongodbClientVersion }} +# uses: ./.github/actions/scenarios/database-write-prohibition/mongodb + test-for-database-write-prohibition-mysql: + name: Test for database-write-prohibition mysql + runs-on: ubuntu-latest + needs: [build-agent-and-cache, download-midwares-and-cache] + strategy: + matrix: + include: + - mysqlClientVersion: "2.6.2" +# - mysqlClientVersion: "2.7.6" +# - mysqlClientVersion: "2.7.12" +# - mysqlClientVersion: "3.0.6" +# - mysqlClientVersion: "3.0.11" +# - mysqlClientVersion: "3.1.4" +# - mysqlClientVersion: "3.2.0" +# - mysqlClientVersion: "3.3.3" + fail-fast: false + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 100 + - name: set java version to environment + run: | + echo "javaVersion=8" >> $GITHUB_ENV + - name: common operations + uses: ./.github/actions/common/database-write-prohibition + - name: database-write-prohibition-mysql test for mysqlVersion=${{ matrix.mysqlVersion }} + uses: ./.github/actions/scenarios/database-write-prohibition/mysql \ No newline at end of file