This repository was archived by the owner on Feb 11, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 38
Dev/1.2.2 #32
Merged
Merged
Dev/1.2.2 #32
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c72f719
Добавлено: обновлена документация по аутентификации и изменен тип уст…
ink-developer 75fc48f
Добавлено: настройка тестирования с использованием pytest и интеграци…
ink-developer 02918a3
Бамп версии
ink-developer 4f1b2f6
фиксы1
ink-developer 9a9ffa1
Merge branch 'main' into dev/1.2.2
ink-developer 06958d5
исправил воркфлоу
ink-developer c5852aa
исправил воркфлоу 2
ink-developer c9c2946
исправил воркфлоу 3 + исправил пайпроджект
ink-developer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ['3.10', '3.11', '3.12', '3.13'] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Cache pip packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| - name: Install runtime + test tools | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| # Устанавливаем package (runtime deps) | ||
| pip install -e "." | ||
| # Явно ставим инструменты для тестов/линта, чтобы они были доступны в runner | ||
| pip install pytest pytest-asyncio pytest-cov pytest-timeout flake8 mypy | ||
|
|
||
| - name: Lint with flake8 | ||
| run: | | ||
| flake8 src/pymax tests \ | ||
| --count \ | ||
| --select=E9,F63,F7,F82 \ | ||
| --show-source \ | ||
| --statistics | ||
| flake8 src/pymax tests \ | ||
| --count \ | ||
| --exit-zero \ | ||
| --max-complexity=10 \ | ||
| --max-line-length=79 \ | ||
| --statistics | ||
| continue-on-error: true | ||
|
|
||
| - name: Type check with mypy | ||
| run: | | ||
| mypy src/pymax \ | ||
| --ignore-missing-imports \ | ||
| --no-error-summary | ||
| continue-on-error: true | ||
|
|
||
| - name: Run unit tests | ||
| run: | | ||
| pytest -m "not mockserver" \ | ||
| --cov=src/pymax \ | ||
| --cov-report=xml \ | ||
| --cov-report=term-missing | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| files: coverage.xml | ||
| flags: unittests | ||
| name: codecov-umbrella | ||
| fail_ci_if_error: false | ||
|
|
||
| - name: Archive pytest cache | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: pytest-cache-${{ matrix.python-version }} | ||
| path: .pytest_cache/ | ||
| retention-days: 5 | ||
|
|
||
| integration-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository (with submodules) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.13' | ||
|
|
||
| - name: Install runtime + test tools (integration) | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e "." | ||
| pip install pytest pytest-asyncio pytest-cov pytest-timeout flake8 mypy | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.22' | ||
|
|
||
| - name: Start MockServer | ||
| run: | | ||
| git clone https://github.com/fresh-milkshake/gomax-prerelease.git | ||
| cd gomax-prerelease/mockserver | ||
| go mod download | ||
| go run cmd/server/main.go & | ||
| sleep 3 | ||
|
|
||
| - name: Run integration tests | ||
| run: | | ||
| pytest -m mockserver -v --tb=short | ||
| continue-on-error: true | ||
| env: | ||
| MOCKSERVER_WS_URL: ws://localhost:8080/ | ||
| MOCKSERVER_HTTP_URL: http://localhost:8080 | ||
|
|
||
| code-quality: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.13' | ||
|
|
||
| - name: Install dependencies + quality tools | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e "." | ||
| # black/isort/pylint используются только в этом job | ||
| pip install black isort pylint | ||
|
|
||
| - name: Check code formatting with black | ||
| run: black --check src/pymax tests | ||
| continue-on-error: true | ||
|
|
||
| - name: Check import sorting with isort | ||
| run: isort --check-only src/pymax tests | ||
| continue-on-error: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,26 @@ | ||
| [pytest] | ||
|
|
||
| asyncio_mode = auto | ||
|
|
||
| testpaths = tests | ||
|
|
||
| python_files = test_*.py | ||
| python_classes = Test* | ||
| python_functions = test_* | ||
| addopts = -v --tb=short | ||
|
|
||
| addopts = | ||
| -v | ||
| --tb=short | ||
| --strict-markers | ||
| -ra | ||
| --color=yes | ||
|
|
||
| markers = | ||
| asyncio: асинхронные тесты | ||
| mockserver: интеграционные тесты с MockServer | ||
| integration: интеграционные тесты | ||
| slow: медленные тесты | ||
| unit: модульные тесты | ||
| skip_ci: пропустить в CI | ||
|
|
||
| timeout = 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unpinned external repository and fragile server startup.
Two concerns:
gomax-prereleasewithout a specific commit/tag means CI can break unexpectedly if that repo changes.sleep 3is fragile; the server may not be ready in time, causing flaky tests.🔎 Proposed improvements
- name: Start MockServer run: | - git clone https://github.com/fresh-milkshake/gomax-prerelease.git + git clone --depth 1 --branch v1.0.0 https://github.com/fresh-milkshake/gomax-prerelease.git cd gomax-prerelease/mockserver go mod download go run cmd/server/main.go & - sleep 3 + # Wait for server to be ready + for i in {1..30}; do + curl -s http://localhost:8080/health && break || sleep 1 + done🤖 Prompt for AI Agents