forked from NVDARemote/remote-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Add Unit Tests #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
7008cb5
Use UV as package manager (from remote-server@codeStandards)
SaschaCowley aad4832
Add coverage
SaschaCowley 0fb600d
Add initial test
SaschaCowley da27071
Ensure creating users starts from a known baseline
SaschaCowley af13779
Add tests for server state
SaschaCowley d7d1d08
Add test for single password generation
SaschaCowley 24e6315
More test for key generation
SaschaCowley c29644f
Minor fixes to tests
SaschaCowley 1a64b03
Add .py,cover files to gitignore
SaschaCowley f274f45
Add coverage config to pyproject
SaschaCowley d18386c
Addd channel lifecycle tests
SaschaCowley ac62012
Refactor tests
SaschaCowley 89f2597
Add tests for broadcast
SaschaCowley 623c784
Up test coverage threshold since we've passed 80% coverage
SaschaCowley 8c1dbd6
Add tests for channel.add_user
SaschaCowley 7bf9d72
Add tests for channel
SaschaCowley 02b18e6
Add docstrings and rearrange
SaschaCowley 0df35b8
Exclude main, __name__=__main__, and tcpnodelay from coverage
SaschaCowley 83d7548
Increase fail under to 95 as 90% coverage has been achieved
SaschaCowley e7b6434
Add tests for ping_connected_clients
SaschaCowley d9b4de7
Add several tests
SaschaCowley 88f186d
Slight refactor of tests
SaschaCowley aede57b
Coverage workflow
SaschaCowley 99fb957
Update test workflow
SaschaCowley f72e48c
Up the fail under to test failure for insufficient coverage
SaschaCowley d08d71d
Set fail-under to 0 when generateing artifacts
SaschaCowley 67ca5c5
Fix typo
SaschaCowley 2ecbea3
Try github step summary
SaschaCowley 60f23a0
Apply suggestions from code review
SaschaCowley dbb13b8
Update .gitignore
SaschaCowley c092ffb
Fix typo
SaschaCowley 5a042bf
Lint and format with ruff
SaschaCowley 8597f16
Lower fail under to 95
SaschaCowley 14c2765
Fix non dict message test case
SaschaCowley a897c33
Add more tests for user
SaschaCowley 4a65dde
Add test for MOTD
SaschaCowley 3b2ce94
Branch coverage for channel join
SaschaCowley f44e58b
Ignore intentionally untested code and partial branches
SaschaCowley 96bd029
Up fail under to 100 again
SaschaCowley 1f1db01
Add comment
SaschaCowley b7a59c8
Clarify comment
SaschaCowley 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,39 @@ | ||
| name: Run automated tests | ||
|
|
||
| on: push | ||
|
|
||
| jobs: | ||
| coverage: | ||
| name: Check coverage with coverage.py | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v4.2.2 | ||
| - name: Install the latest version of uv | ||
| uses: astral-sh/setup-uv@v6.1.0 | ||
| - name: Setup environment | ||
| run: uv sync --dev | ||
| - name: Run unit tests | ||
| run: uv run coverage run | ||
| - name: Report coverage | ||
| run: uv run coverage report --format markdown >> $GITHUB_STEP_SUMMARY | ||
| - name: Generate coverage artifacts | ||
| if: ${{ failure() }} | ||
| run: | | ||
| uv run coverage html --fail-under 0 | ||
| uv run coverage xml --fail-under 0 | ||
| uv run coverage json --fail-under 0 | ||
| uv run coverage lcov --fail-under 0 | ||
| uv run coverage annotate | ||
| - name: Upload artifacts | ||
| if: ${{ failure() }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Coverage reports | ||
| path: | | ||
| coverage.json | ||
| coverage.lcov | ||
| coverage.xml | ||
| htmlcov/ | ||
| *.py,cover | ||
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,6 @@ | ||
| .venv/ | ||
| # Temporary unit testing artefacts | ||
| _trial_temp/ | ||
|
SaschaCowley marked this conversation as resolved.
|
||
| __pycache__/ | ||
| .coverage | ||
| *.py,cover | ||
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.
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.
Uh oh!
There was an error while loading. Please reload this page.