-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding unit tests for MetaDefender service
- Loading branch information
1 parent
0ba8915
commit b42b208
Showing
6 changed files
with
648 additions
and
5 deletions.
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
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,36 @@ | ||
name: tests | ||
|
||
trigger: ["*"] | ||
pr: ["*"] | ||
|
||
pool: | ||
vmImage: "ubuntu-20.04" | ||
|
||
jobs: | ||
- job: run_test | ||
strategy: | ||
matrix: | ||
python3_7: | ||
python.version: "3.7" | ||
Python3_8: | ||
python.version: "3.8" | ||
|
||
timeoutInMinutes: 10 | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
displayName: Set python version | ||
inputs: | ||
versionSpec: "$(python.version)" | ||
- script: | | ||
sudo apt-get update | ||
sudo apt-get install -y qemu-utils libfuzzy-dev libfuzzy2 | ||
sudo rm -rf /var/lib/apt/lists/* | ||
sudo env "PATH=$PATH" python -m pip install -U --no-cache-dir assemblyline assemblyline_v4_service | ||
sudo env "PATH=$PATH" python -m pip install -U --no-cache-dir -r `pwd`/test/requirements.txt | ||
sudo rm -rf /tmp/* /var/lib/apt/lists/* ~/.cache/pip | ||
displayName: Setup environment | ||
- script: python -m pytest --durations=10 -rsx -vv --cov-report=xml --cov=metadefender | ||
displayName: Test | ||
- script: python -m codecov | ||
displayName: Upload Coverage |
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,5 @@ | ||
pytest | ||
requests-mock | ||
pytest-mock | ||
pytest-cov | ||
codecov |
1 change: 1 addition & 0 deletions
1
test/results/dadc624d4454e10293dbd1b701b9ee9f99ef83b4cd07b695111d37eb95abcff8.json
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 @@ | ||
{"classification": "TLP:W", "response": {"milestones": {"service_started": null, "service_completed": null}, "service_version": null, "service_name": "metadefender", "service_tool_version": null, "supplementary": [], "extracted": [], "service_context": null, "service_debug_info": null}, "result": {"score": 0, "sections": []}, "sha256": "dadc624d4454e10293dbd1b701b9ee9f99ef83b4cd07b695111d37eb95abcff8", "drop_file": false, "temp_submission_data": {}} |
1 change: 1 addition & 0 deletions
1
test/samples/dadc624d4454e10293dbd1b701b9ee9f99ef83b4cd07b695111d37eb95abcff8
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 @@ | ||
this is a text file |
Oops, something went wrong.