Skip to content

Commit

Permalink
Update SparkApp configuration and test case for notebook path validation
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwenyihust committed Aug 22, 2024
1 parent e29fd4f commit b2588d3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/tests/services/test_spark_app_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from app.models.user import UserModel
from app.services.notebook import Notebook
from app.services.spark_app import SparkApp
from app.models.spark_app_config import SparkAppConfigModel
import datetime
import json

Expand Down Expand Up @@ -111,6 +112,17 @@ def test_update_spark_app_config(self):
self.assertEqual(response_2.status_code, 200)
self.assertEqual(json.loads(response_2.data)['message'], 'Updated spark app config')

# Check that spark app config is in the database
spark_app_config = SparkAppConfigModel.query.filter_by(notebook_id=notebook_0.id).first()
self.assertIsNotNone(spark_app_config)
self.assertEqual(spark_app_config.driver_memory, '2g')
self.assertEqual(spark_app_config.driver_cores, 1)
self.assertEqual(spark_app_config.executor_memory, '2g')
self.assertEqual(spark_app_config.executor_cores, 2)
self.assertEqual(spark_app_config.executor_instances, 2)
self.assertEqual(spark_app_config.dynamic_allocation_enabled, True)



def test_create_spark_app(self):
with self.app.app_context():
Expand Down

0 comments on commit b2588d3

Please sign in to comment.