Skip to content

Commit

Permalink
added some coverage for JobDescriptor, fixed hard-clean for Mac
Browse files Browse the repository at this point in the history
inflector committed Oct 4, 2017
1 parent 3136feb commit 4e6055a
Showing 2 changed files with 39 additions and 4 deletions.
35 changes: 35 additions & 0 deletions agent/tests/test_jobs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import logging

import pytest
from sn_agent.log import setup_logging
from sn_agent import ontology
from sn_agent.ontology.service_descriptor import ServiceDescriptor
from sn_agent.job.job_descriptor import JobDescriptor
from sn_agent.job.job_descriptor import init_test_jobs

log = logging.getLogger(__name__)



# Tests

# Test performance of services - all of them
def test_jobs():
print()
setup_logging()
init_test_jobs()
test_jobs = JobDescriptor.get_test_jobs(ontology.DOCUMENT_SUMMARIZER_ID)
for job in test_jobs:
service_id = 0
if str(job) != "NO_JOB":
service_id = ontology.DOCUMENT_SUMMARIZER_ID

job_parameters = {'input_type': 'file',
'input_url': 'http://test.com/inputs/test_input.txt',
'output_type': 'file_url_put',
'output_url': 'test_output.txt'}
service_id = ontology.DOCUMENT_SUMMARIZER_ID
new_job = JobDescriptor(ServiceDescriptor(service_id), job_parameters)
test_jobs.append(new_job)
total_jobs = len(test_jobs)
del test_jobs[total_jobs-1]
8 changes: 4 additions & 4 deletions tools.sh
Original file line number Diff line number Diff line change
@@ -56,10 +56,10 @@ clean)

hard-clean)
docker-compose down --rmi all --remove-orphans
docker ps -q | xargs -r docker kill
docker ps -a -q | xargs -r docker rm
docker images -q | xargs -r docker rmi
docker volume ls -qf dangling=true | xargs -r docker volume rm
docker kill `docker ps -q`
docker rm `docker ps -a -q`
docker rmi `docker images -q`
docker volume rm `docker volume ls -qf dangling=true`
;;

create-web-cookie)

0 comments on commit 4e6055a

Please sign in to comment.