From adcd8605150a9195441086670d65071880473486 Mon Sep 17 00:00:00 2001 From: dinream <2534393465@qq.com> Date: Mon, 14 Oct 2024 11:19:56 +0800 Subject: [PATCH 1/4] CI test --- src/dbtest/requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/dbtest/requirements.txt diff --git a/src/dbtest/requirements.txt b/src/dbtest/requirements.txt new file mode 100644 index 00000000..e18698a8 --- /dev/null +++ b/src/dbtest/requirements.txt @@ -0,0 +1,4 @@ +certifi==2020.6.20 +pip==19.3.1 +setuptools==44.0.0 +wheel==0.37.1 From 88d1cff3de0feb458a43b2bef6a460fd79587941 Mon Sep 17 00:00:00 2001 From: dinream <2534393465@qq.com> Date: Mon, 14 Oct 2024 11:22:56 +0800 Subject: [PATCH 2/4] ci.yml --- .github/workflows/ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7f1869be --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI + +on: + pull_request: + branches: + - coo-consistency-check + push: + branches: + - coo-consistency-check + +jobs: + build_and_test: + runs-on: ubuntu-latest + + steps: + - name: CheckCode + uses: actions/checkout@v3 + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake g++ libgflags-dev unixodbc unixodbc-dev odbcinst locales curl + sudo locale-gen en_US.UTF-8 + + - name: Install Python2 + run: sudo apt-get install -y python2 + + - name: Install pip2 + run: | + curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py + python2 get-pip.py + + - name: Install Python Lib + run: python2 -m pip install -r ./src/dbtest/requirements.txt + + - name: Compile 3TSCOO + working-directory: ./src/dbtest + run: | + set -e + cmake -S ./ + make + + - name: Verify the compilation output + working-directory: ./src/dbtest + run: | + set -e + if [ -f 3ts_dbtest ]; then echo "3ts_dbtest exists"; else echo "3ts_dbtest not found"; exit 1; fi + if [ -f 3ts_dbtest_v2 ]; then echo "3ts_dbtest_v2 exists"; else echo "3ts_dbtest_v2 not found"; exit 1; fi + + - name: Check executable file update time + working-directory: ./src/dbtest + run: | + set -e + BUILD_TIME=$(date +%s) + FILE1_TIME=$(stat -c %Y 3ts_dbtest) + FILE2_TIME=$(stat -c %Y 3ts_dbtest_v2) + TIME_DIFF1=$((BUILD_TIME - FILE1_TIME)) + TIME_DIFF2=$((BUILD_TIME - FILE2_TIME)) + if [ "$TIME_DIFF1" -lt 300 ]; then echo "3ts_dbtest was updated recently"; else echo "3ts_dbtest was not updated recently"; exit 1; fi + if [ "$TIME_DIFF2" -lt 300 ]; then echo "3ts_dbtest_v2 was updated recently"; else echo "3ts_dbtest_v2 was not updated recently"; exit 1; fi + + - name: Run Python test + run: | + set -e + python2 -c "import certifi; print(certifi.__version__)" From a96dcf1e856d54cd441fa796934da3b2d4228fe6 Mon Sep 17 00:00:00 2001 From: dinream <2534393465@qq.com> Date: Mon, 14 Oct 2024 17:40:46 +0800 Subject: [PATCH 3/4] update python Queue->queue --- src/dbtest/src/mda_detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dbtest/src/mda_detect.py b/src/dbtest/src/mda_detect.py index 982361ea..76405b2d 100644 --- a/src/dbtest/src/mda_detect.py +++ b/src/dbtest/src/mda_detect.py @@ -10,7 +10,7 @@ # */ -import Queue +import queue import os import time @@ -563,7 +563,7 @@ def remove_unfinished_operation(data_op_list): """ # toposort to determine whether there is a cycle def check_cycle(edge, indegree, total): - q = Queue.Queue() + q = queue.Queue() for i, degree in enumerate(indegree): if degree == 0: q.put(i) ans = [] From 4382f49e1739d56d28ccdeffc8375f5de4c6d832 Mon Sep 17 00:00:00 2001 From: dinream <2534393465@qq.com> Date: Mon, 14 Oct 2024 17:41:35 +0800 Subject: [PATCH 4/4] update ci python2 to python3 --- .github/workflows/ci.yml | 18 +++++++++--------- src/dbtest/requirements.txt | 4 ---- 2 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 src/dbtest/requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f1869be..24454c45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,16 +22,15 @@ jobs: sudo apt-get install -y cmake g++ libgflags-dev unixodbc unixodbc-dev odbcinst locales curl sudo locale-gen en_US.UTF-8 - - name: Install Python2 - run: sudo apt-get install -y python2 - - - name: Install pip2 + - name: Check Python version run: | - curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py - python2 get-pip.py + python --version + pip --version - - name: Install Python Lib - run: python2 -m pip install -r ./src/dbtest/requirements.txt + - name: Install Python Dependencies + run: | + python -m pip install --upgrade pip + pip install certifi - name: Compile 3TSCOO working-directory: ./src/dbtest @@ -62,4 +61,5 @@ jobs: - name: Run Python test run: | set -e - python2 -c "import certifi; print(certifi.__version__)" + python -c "import certifi; print(certifi.__version__)" + # python ./src/dbtest/src/mda_detect.py diff --git a/src/dbtest/requirements.txt b/src/dbtest/requirements.txt deleted file mode 100644 index e18698a8..00000000 --- a/src/dbtest/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -certifi==2020.6.20 -pip==19.3.1 -setuptools==44.0.0 -wheel==0.37.1