-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Test #23
Merged
Merged
Test #23
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1c9e5d8
fix : dummy driver added to tests
sepandhaghighi 330211a
fix : function test added
sepandhaghighi 162ad19
fix : pytest added to test.yml
sepandhaghighi d60264e
fix : pytest.ini file added
sepandhaghighi 5fb77f8
fix : sudo privilege added to linux test
sepandhaghighi c82857c
fix : sudo privilege added to linux test
sepandhaghighi 6bbf77e
fix : sudo privilege added to linux test
sepandhaghighi b3e5a19
fix : test system isolation
sepandhaghighi d2eff0f
fix : codecov action added to tests
sepandhaghighi e03ba98
fix : error tests added
sepandhaghighi 3954c9e
fix : windows-2019 added to os-matrix
sepandhaghighi 92497de
fix : macOS-11 added to os-matrix
sepandhaghighi a9c4426
fix : nava functions test updated
sepandhaghighi 22c2c46
fix : one general exception removed from coverage
sepandhaghighi 55dc6dd
fix : coverage config files added
sepandhaghighi d6d4dae
doc : CHANGELOG.md updated
sepandhaghighi b8a1caa
doc : CI badges updated
sepandhaghighi 17324a2
doc : codecov badge added
sepandhaghighi 27cbda8
doc : minor edit in codecov badge
sepandhaghighi 91bb794
fix : minor edit in windows_test.yml
sepandhaghighi 6bd15dd
fix : apt-get update added to linux test
sepandhaghighi fb7b1a3
fix : some extra app removed from linux test
sepandhaghighi 3c2cfe9
change : sound trimed to its first 0.35s.
sadrasabouri 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 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,9 @@ | ||
[run] | ||
branch = True | ||
omit = | ||
*/nava/__main__.py | ||
*/nava/__init__.py | ||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
pragma: no cover |
This file contains 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,64 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Linux | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
TEST_PYTHON_VERSION: 3.9 | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0, 3.11.0] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Installation | ||
run: | | ||
sudo python -m pip install --upgrade pip | ||
sudo pip install -r requirements.txt | ||
sudo python setup.py install | ||
- name: First test | ||
run: | | ||
sudo nava | ||
- name: Install ALSA | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install alsa-utils | ||
sudo apt-get install alsa-tools | ||
sudo apt-get install alsa-firmware-loaders | ||
sudo apt-get install alsa-oss | ||
sudo apt-get install -y software-properties-common | ||
sudo apt-get install linux-modules-extra-$(uname -r) | ||
sudo modprobe snd-dummy | ||
- name: Test requirements Installation | ||
run: | | ||
sudo python others/requirements-splitter.py | ||
sudo pip install --upgrade --upgrade-strategy=only-if-needed -r test-requirements.txt | ||
- name: Test with pytest | ||
run: | | ||
sudo python -m pytest --cov=nava --cov-report=term | ||
- name: Other tests | ||
run: | | ||
sudo python -m vulture nava/ others/ setup.py --min-confidence 65 --exclude=__init__.py --sort-by-size | ||
sudo python -m bandit -r nava -s B404,B603,B605,B607 | ||
sudo python -m pydocstyle -v --match-dir=nava | ||
if: matrix.python-version == env.TEST_PYTHON_VERSION | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
fail_ci_if_error: false | ||
if: matrix.python-version == env.TEST_PYTHON_VERSION | ||
- name: Version check | ||
run: | | ||
python others/version_check.py | ||
if: matrix.python-version == env.TEST_PYTHON_VERSION |
This file contains 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 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,63 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Windows | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
TEST_PYTHON_VERSION: 3.9 | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-2022, windows-2019] | ||
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0, 3.11.0] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Installation | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
python setup.py install | ||
- name: First test | ||
run: | | ||
nava | ||
- name: Install Scream | ||
shell: powershell | ||
run: | | ||
Start-Service audio* | ||
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip | ||
Extract-7Zip -Path C:\Scream3.6.zip -DestinationPath C:\Scream | ||
$cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate | ||
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine") | ||
$store.Open("ReadWrite") | ||
$store.Add($cert) | ||
$store.Close() | ||
cd C:\Scream\Install\driver | ||
C:\Scream\Install\helpers\devcon install Scream.inf *Scream | ||
- name: Test requirements Installation | ||
run: | | ||
python others/requirements-splitter.py | ||
pip install --upgrade --upgrade-strategy=only-if-needed -r test-requirements.txt | ||
- name: Test with pytest | ||
run: | | ||
python -m pytest --cov=nava --cov-report=term | ||
- name: Other tests | ||
run: | | ||
python -m vulture nava/ others/ setup.py --min-confidence 65 --exclude=__init__.py --sort-by-size | ||
python -m bandit -r nava -s B404,B603,B605,B607 | ||
python -m pydocstyle -v --match-dir=nava | ||
if: matrix.python-version == env.TEST_PYTHON_VERSION | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
fail_ci_if_error: false | ||
if: matrix.python-version == env.TEST_PYTHON_VERSION |
This file contains 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 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 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,14 @@ | ||
codecov: | ||
require_ci_to_pass: yes | ||
|
||
coverage: | ||
precision: 2 | ||
round: up | ||
range: "70...100" | ||
status: | ||
patch: | ||
default: | ||
enabled: no | ||
project: | ||
default: | ||
threshold: 1% |
This file contains 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
Binary file not shown.
This file contains 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,4 @@ | ||
# content of pytest.ini | ||
[pytest] | ||
addopts = --doctest-modules --ignore=others | ||
doctest_optionflags= NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL |
This file contains 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,12 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
>>> from nava import play | ||
>>> play("test.wav") | ||
Traceback (most recent call last): | ||
... | ||
nava.errors.NavaBaseError: Given sound file doesn't exist. | ||
>>> play(1) | ||
Traceback (most recent call last): | ||
... | ||
nava.errors.NavaBaseError: Sound file's path should be a string. | ||
""" |
This file contains 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,14 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
>>> import os | ||
>>> from nava import play | ||
>>> play(os.path.join("others", "test.wav")) | ||
>>> from nava.functions import nava_help | ||
>>> nava_help() | ||
<BLANKLINE> | ||
A Python library for playing sound everywhere natively and securely. | ||
<BLANKLINE> | ||
<BLANKLINE> | ||
Repo : https://github.com/openscilab/nava | ||
Webpage : https://openscilab.com/ | ||
""" |
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.
I couldn't find the exact place in which we test the correct performance of the
play
function. (As you said, comparing waveforms and etc.)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.
Github Action does not install any drivers by default. After installing the driver, if the system succeeds in playing the file, no error will occur. That's enough at the moment.