Commit dd74904a authored by Daniele Venzano's avatar Daniele Venzano

Cleanup zoe-master tests

parent 2db91879
......@@ -37,12 +37,6 @@ def configuration(request):
return get_conf()
@pytest.fixture(scope='session')
def application_dict():
jsondata = open("zoe_master/tests/resources/spark-wordcount-test.json", "r")
return json.load(jsondata)
@pytest.fixture(scope='function')
def state_manager(configuration):
return StateManager(FSBlobs)
{
"name": "Spark wordcount test",
"user_id": 0,
"version": 0,
"will_end": true,
"priority": 512,
"requires_binary": true,
"processes": [
{
"name": "spark-master",
"version": 0,
"docker_image": "/zoerepo/spark-master",
"monitor": false,
"required_resources": {
"memory": 2147483648
},
"ports": [
{
"name": "Spark master web interface",
"protocol": "http",
"port_number": 8080,
"path": "/",
"is_main_endpoint": false
}
]
},
{
"name": "spark-worker-1",
"version": 0,
"docker_image": "/zoerepo/spark-worker",
"monitor": false,
"required_resources": {
"memory": 4294967296
},
"ports": [
{
"name": "Spark worker web interface",
"protocol": "http",
"port_number": 8081,
"path": "/",
"is_main_endpoint": false
}
],
"environment": [
["SPARK_WORKER_CORES", "4"],
["SPARK_WORKER_RAM", "4g"],
["SPARK_MASTER_IP", "{cluster[spark-master][ip_address]}"]
]
},
{
"name": "spark-worker-2",
"version": 0,
"docker_image": "/zoerepo/spark-worker",
"monitor": false,
"required_resources": {
"memory": 4294967296
},
"ports": [
{
"name": "Spark worker web interface",
"protocol": "http",
"port_number": 8081,
"path": "/",
"is_main_endpoint": false
}
],
"environment": [
["SPARK_WORKER_CORES", "4"],
["SPARK_WORKER_RAM", "4g"],
["SPARK_MASTER_IP", "{cluster[spark-master][ip_address]}"]
]
},
{
"name": "spark-submit",
"version": 0,
"docker_image": "/zoerepo/spark-submit",
"monitor": true,
"required_resources": {
"memory": 4294967296
},
"ports": [
{
"name": "Spark application web interface",
"protocol": "http",
"port_number": 4040,
"path": "/",
"is_main_endpoint": true
}
],
"environment": [
["SPARK_MASTER_IP", "{cluster[spark-master][ip_address]}"],
["SPARK_OPTIONS", ""],
["SPARK_EXECUTOR_RAM", "4g"],
["APPLICATION_URL", "{application_binary_url}"]
],
"command": "/opt/submit.sh wordcount.py hdfs://192.168.45.157/datasets/gutenberg_big_2x.txt hdfs://192.168.45.157/tmp/cntwdc1"
}
]
}
......@@ -13,16 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from zoe_master.state.application import ApplicationDescription, ServiceDescription, ServiceEndpointDescription
from zoe_master.state.user import User
def test_application():
ApplicationDescription()
def test_process():
ServiceDescription()
def test_process_endpoint():
ServiceEndpointDescription()
def test_manager(state_manager):
user = User(state_manager)
user_id = state_manager.gen_id()
user.id = user_id
state_manager.new('user', user)
assert state_manager.users[user_id] == user
guser = state_manager.get_one('user', id=user_id)
assert guser == user
state_manager.delete('user', user_id)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment