From 9ee5bc6845ee07e086801673f1cbc39854f20108 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 12 Dec 2025 10:16:56 +0800 Subject: [PATCH 1/5] update unit test CI env --- .github/workflows/release.yml | 1 + .github/workflows/unit_tests.yml | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb313c2..164535a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,7 @@ on: jobs: build: runs-on: ubuntu-latest + needs: test steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 9db5482..621e94c 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -46,10 +46,10 @@ jobs: needs: - list-test-files container: - image: 10.0.13.31:5000/modelcloud/gptqmodel:github-ci-v7 + image: 10.0.13.31:5000/nvidia/cuda:130-ubuntu22.04_1021 volumes: - - /home/ci/models:/monster/data/model - - /home/ci/models/huggingface:/github/home/.cache/huggingface + - /monster/ci/models:/monster/data/model + - /monster/ci/huggingface:/github/home/.cache/huggingface strategy: fail-fast: false matrix: @@ -57,8 +57,24 @@ jobs: steps: - uses: actions/checkout@v6 + - name: Print Env + run: | + env_name="logbar_unit_test_py314_build" + + echo "env name: $env_name" + + if [ -d "$(pyenv root)/versions/$env_name" ]; then + echo "env exists, skip" + else + echo "creating venv..." + pyenv virtualenv 3.14 "$env_name" + fi + + pyenv local $env_name + pyenv activate $env_name + - name: install requirements - run: pip install parameterized pytest pytest-xdist + run: pip install -U parameterized pytest pytest-xdist - name: install run: pip install . From fb6b4f2af458e6f855067b1df532234840efc81d Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 12 Dec 2025 10:17:47 +0800 Subject: [PATCH 2/5] remove dependencies --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 164535a..cb313c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,6 @@ on: jobs: build: runs-on: ubuntu-latest - needs: test steps: - uses: actions/checkout@v6 From 6569977c32535fe56550cecb30f5a3a6eed617ba Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 12 Dec 2025 10:20:23 +0800 Subject: [PATCH 3/5] add pyenv --- .github/workflows/release.yml | 3 +++ .github/workflows/unit_tests.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb313c2..3b08ddb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,8 @@ name: Release +defaults: + run: + shell: bash -le {0} on: release: types: [ published ] diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 621e94c..6e01ef0 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -48,6 +48,7 @@ jobs: container: image: 10.0.13.31:5000/nvidia/cuda:130-ubuntu22.04_1021 volumes: + - /monster/ci/pyenv:/opt/pyenv - /monster/ci/models:/monster/data/model - /monster/ci/huggingface:/github/home/.cache/huggingface strategy: From 486fd67386fb1b5ba153b6a85d5f80946b431f42 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 12 Dec 2025 10:25:38 +0800 Subject: [PATCH 4/5] create venv with matrix --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 6e01ef0..bb0a901 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -60,7 +60,7 @@ jobs: - name: Print Env run: | - env_name="logbar_unit_test_py314_build" + env_name="logbar_unit_test_py314_${{ matrix.test_script }}" echo "env name: $env_name" From d888355f2c6978979d323e0126ac0d78c3cd1149 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 12 Dec 2025 10:30:08 +0800 Subject: [PATCH 5/5] fix no test --- tests/test_example.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/test_example.py b/tests/test_example.py index c55d09e..0fa35ef 100644 --- a/tests/test_example.py +++ b/tests/test_example.py @@ -4,20 +4,24 @@ # Contact: qubitium@modelcloud.ai, x.com/qubitium import time +import unittest from logbar import LogBar -log = LogBar.shared() -pb_fetch = log.pb(range(80)).title("Fetch").manual() -pb_train = log.pb(range(120)).title("Train").manual() +class TestExample(unittest.TestCase): + def test_example(self): + log = LogBar.shared() -for _ in pb_fetch: - pb_fetch.draw() - time.sleep(0.01) + pb_fetch = log.pb(range(80)).title("Fetch").manual() + pb_train = log.pb(range(120)).title("Train").manual() -for _ in pb_train: - pb_train.draw() - time.sleep(0.01) + for _ in pb_fetch: + pb_fetch.draw() + time.sleep(0.01) -pb_train.close() -pb_fetch.close() + for _ in pb_train: + pb_train.draw() + time.sleep(0.01) + + pb_train.close() + pb_fetch.close()