Bin
2025-12-17 262fecaa75b2909ad244f12c3b079ed3ff4ae329
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: "Tests"
 
on:
  workflow_call:
    inputs:
      head_sha:
        required: true
        type: string
  workflow_dispatch:
    inputs:
      head_sha:
        description: 'ref or SHA'
        required: true
        type: string
        default: 'develop'
 
env:
  NODE: "22"
  CACHE_NAME_PREFIX: v1
  POETRY_VERSION: 2.1.4
  DJANGO_SETTINGS_MODULE: core.settings.label_studio
  COVERAGE_PROCESS_START: 1
  LOG_DIR: pytest_logs
  COLLECT_ANALYTICS: false
  DEBUG_CONTEXTLOG: true
  LABEL_STUDIO_TEST_ENVIRONMENT: false
  SENTRY_RATE: 0
  JSON_LOG: 0
 
jobs:
  run_pytest_sqlite:
    name: LS SQLite Ubuntu
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version:
          - '3.10'
          - '3.11'
          - '3.12'
          - '3.13'
 
    env:
      SENTRY_ENVIRONMENT: tests-ubuntu-sqlite
      DJANGO_DB: sqlite
 
    steps:
      - uses: hmarr/debug-action@v3.0.0
 
      - name: Checkout
        uses: actions/checkout@v6
        with:
          ref: ${{ inputs.head_sha }}
 
      - name: "Install poetry"
        run: pipx install "poetry==${{ env.POETRY_VERSION }}"
 
      - name: "Set up Python ${{ matrix.python-version }}"
        id: setup_python
        uses: actions/setup-python@v6
        with:
          python-version: '${{ matrix.python-version }}'
          cache: 'poetry'
 
      - name: Install OS dependencies
        run: |
          sudo apt-get update
          sudo apt-get install libffi8 libldap2-dev libsasl2-dev libssl-dev libxml2-dev libxslt-dev python3-dev
 
      - name: Install Python dependencies
        run: poetry install --with test
 
      - name: Generate version file
        run: poetry run python label_studio/core/version.py
 
      - name: Run functional tests
        working-directory: label_studio
        run: poetry run pytest --disable-warnings --durations=30 -n auto
 
  run_pytest_postgresql:
    name: LS PostgreSQL Ubuntu
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: [ '3.13' ]
    env:
      DJANGO_DB: default
      COVERAGE_PROCESS_START: .coveragerc
      PYTHONPATH: .
      LOG_LEVEL: ERROR
      SENTRY_ENVIRONMENT: tests-ubuntu-postgresql
 
    services:
      postgres:
        image: postgres:13
        env:
          POSTGRES_PASSWORD: postgres
          POSTGRES_USER: postgres
          POSTGRES_DB: postgres
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 5432:5432
    steps:
      - uses: hmarr/debug-action@v3.0.0
 
      - name: Checkout
        uses: actions/checkout@v6
        with:
          ref: ${{ inputs.head_sha }}
 
      - name: "Install poetry"
        run: pipx install "poetry==${{ env.POETRY_VERSION }}"
 
      - name: "Set up Python ${{ matrix.python-version }}"
        id: setup_python
        uses: actions/setup-python@v6
        with:
          python-version: '${{ matrix.python-version }}'
          cache: 'poetry'
 
      - name: Install OS dependencies
        run: |
          sudo apt-get update
          sudo apt-get install libffi8 libldap2-dev libsasl2-dev libssl-dev libxml2-dev libxslt-dev python3-dev
 
      - name: Install Python dependencies
        run: poetry install --with test
 
      - name: Generate version file
        run: poetry run python label_studio/core/version.py
 
      - name: Run functional tests
        working-directory: label_studio
        run: poetry run pytest --disable-warnings --cov=. --cov-report=xml --junitxml=functional.xml --durations=30 -n auto
 
      - name: Upload coverage to Codecov
        if: ${{ github.event.pull_request.head.repo.fork == false && github.event.pull_request.user.login != 'dependabot[bot]' }}
        uses: codecov/codecov-action@v5
        with:
          name: codecov-python-${{ matrix.python-version }}
          flags: pytests
          files: ./label_studio/coverage.xml
          token: ${{ secrets.CODECOV_TOKEN }}
          verbose: true
          fail_ci_if_error: true
 
      - name: "Upload functional tests results to Codecov"
        if: ${{ github.event.pull_request.head.repo.fork == false && github.event.pull_request.user.login != 'dependabot[bot]' }}
        uses: codecov/test-results-action@v1
        with:
          files: ./label_studio/functional.xml
          name: codecov-general-test-results
          flags: functional
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: false
 
  windows_label_studio:
    name: LS SQLite Windows
    runs-on: windows-latest
    strategy:
      fail-fast: false
      matrix:
        python-version:
          - '3.10'
    defaults:
      run:
        shell: bash
    env:
      SENTRY_ENVIRONMENT: tests-windows-sqlite
      DJANGO_DB: sqlite
    steps:
      - uses: hmarr/debug-action@v3.0.0
 
      - name: Checkout
        uses: actions/checkout@v6
        with:
          ref: ${{ inputs.head_sha }}
 
      - name: "Install poetry"
        run: pipx install "poetry==${{ env.POETRY_VERSION }}"
 
      - name: "Set up Python ${{ matrix.python-version }}"
        id: setup_python
        uses: actions/setup-python@v6
        with:
          python-version: '${{ matrix.python-version }}'
          cache: 'poetry'
 
      - name: Install Python dependencies
        run: poetry install --with test
 
      - name: Init project
        run: |
          set PYTHONIOENCODING=utf-8
          set PYTHONLEGACYWINDOWSSTDIO=utf-8
          bash -c "poetry run label-studio init my_project --username test@test.com --password testpwd"
        shell: cmd
 
      - name: Test with pytest
        working-directory: label_studio
        run: poetry run pytest --disable-warnings --durations=30 -n auto