From 03ef88b030c0f9cd542b7841749ff0afcf70ecf2 Mon Sep 17 00:00:00 2001 From: Quentin Durand Date: Thu, 25 Jan 2018 15:53:19 +0100 Subject: [PATCH] merge --- doc/uml/activities/scheduler/Scheduling.png | Bin 0 -> 112010 bytes doc/uml/activities/scheduler/compute_schedule_act.png | Bin 0 -> 51259 bytes doc/uml/activities/scheduler/copy_from_previous_schedule_act.png | Bin 0 -> 31576 bytes doc/uml/activities/scheduler/make_schedule_act.png | Bin 0 -> 46348 bytes doc/uml/activities/scheduler/see_schedules_act.png | Bin 0 -> 14735 bytes install.json | 31 +++++++++++++++++++++++++++++++ logs/Readme.md | 28 ---------------------------- misc/templates/base.html | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/alert_manager/tests.py | 96 ++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------ src/pyros/__init__.pyc | Bin 772 -> 0 bytes 10 files changed, 204 insertions(+), 76 deletions(-) create mode 100644 doc/uml/activities/scheduler/Scheduling.png create mode 100644 doc/uml/activities/scheduler/compute_schedule_act.png create mode 100644 doc/uml/activities/scheduler/copy_from_previous_schedule_act.png create mode 100644 doc/uml/activities/scheduler/make_schedule_act.png create mode 100644 doc/uml/activities/scheduler/see_schedules_act.png create mode 100644 install.json delete mode 100644 logs/Readme.md create mode 100644 misc/templates/base.html delete mode 100644 src/pyros/__init__.pyc diff --git a/doc/uml/activities/scheduler/Scheduling.png b/doc/uml/activities/scheduler/Scheduling.png new file mode 100644 index 0000000..b303646 Binary files /dev/null and b/doc/uml/activities/scheduler/Scheduling.png differ diff --git a/doc/uml/activities/scheduler/compute_schedule_act.png b/doc/uml/activities/scheduler/compute_schedule_act.png new file mode 100644 index 0000000..2c22648 Binary files /dev/null and b/doc/uml/activities/scheduler/compute_schedule_act.png differ diff --git a/doc/uml/activities/scheduler/copy_from_previous_schedule_act.png b/doc/uml/activities/scheduler/copy_from_previous_schedule_act.png new file mode 100644 index 0000000..20981fb Binary files /dev/null and b/doc/uml/activities/scheduler/copy_from_previous_schedule_act.png differ diff --git a/doc/uml/activities/scheduler/make_schedule_act.png b/doc/uml/activities/scheduler/make_schedule_act.png new file mode 100644 index 0000000..27f0295 Binary files /dev/null and b/doc/uml/activities/scheduler/make_schedule_act.png differ diff --git a/doc/uml/activities/scheduler/see_schedules_act.png b/doc/uml/activities/scheduler/see_schedules_act.png new file mode 100644 index 0000000..bb63d29 Binary files /dev/null and b/doc/uml/activities/scheduler/see_schedules_act.png differ diff --git a/install.json b/install.json new file mode 100644 index 0000000..ac5ba71 --- /dev/null +++ b/install.json @@ -0,0 +1,31 @@ +{ + "Configuration": { + "env": "ttest_env", + "name": "default", + "path": "/home/portos/IRAP/pyros/", + "requirements": "REQUIREMENTS.txt" + }, + "install": { + "env_bin": [], + "env_pip": [], + "link": [ + "update" + ], + "normal": [], + "special": [ + "create" + ] + }, + "update": { + "env_bin": [], + "env_pip": [ + "install --upgrade pip", + "install --upgrade wheel", + "" + ], + "normal": [], + "special": [ + "requirements" + ] + } +} \ No newline at end of file diff --git a/logs/Readme.md b/logs/Readme.md deleted file mode 100644 index 2e530c6..0000000 --- a/logs/Readme.md +++ /dev/null @@ -1,28 +0,0 @@ -File Logs are organized by module - -every file is reseted at pyros launch except pyros.log -You must clean this directory before pushing. -You can use the pyrosrun.sh clear_logs command. - -For example, logs for the module MONITORING must be in the file : - -> monitoring.logs - -The logs are formated like this : - -> '%(filename)s : %(lineno)s -> %(message)s' -> "filename : line -> message". - -To use the logger you must import logger.config - -> import logger.config as l -> log = l.setupLogger("name", "file_name") - -Basic log : - -> log.info('Your message') - -if you want to log in the file pyros.log you must use logging - -> import logger.config as l -> l.logging.info('Your message') diff --git a/misc/templates/base.html b/misc/templates/base.html new file mode 100644 index 0000000..f05eb77 --- /dev/null +++ b/misc/templates/base.html @@ -0,0 +1,125 @@ + + + + + {% load staticfiles %} + + + + + + + + + SVOM French GFT Control Center + + + + + + + + + + + + + + {% block head %} + + {% endblock %} + + + + + +
+ + + + +
+ + +
+

{% block title %} {% endblock %}

+
+ +
+
+ {% if error %} +
+ {% endif %} + {% if success %} +
+ {% endif %} + {{ message|safe }} +
+
+ {% block content %} + + + {% endblock %} + + +
+ +
+ + + + + + + + + + +{# #} +{# #} + + + + + + + + + + + \ No newline at end of file diff --git a/src/alert_manager/tests.py b/src/alert_manager/tests.py index 8491ad6..497ddbd 100644 --- a/src/alert_manager/tests.py +++ b/src/alert_manager/tests.py @@ -57,51 +57,51 @@ class TestStrategyChange(TestCase): new_alert = Alert.objects.exclude(id=self.alert.id)[0] self.assertEqual(new_alert.strategyobs.id, self.strat2.id, "The new alert should have the 'strat2' strategy") -# OBSOLETE -class AlertListenerTestsCelery(TestCase): - ''' - IMPORTANT : As soon as you do a DB request in a test, the test DB will no longer be synchronized with the DB used by celery - I have no idea why (Paul), but any call to the DB must be done in setup or after all celery actions are finished - ''' - - def test_alert_reception(self): - ''' - Must be launched with scripts/celery_test.sh - Copy a VOEvent file in the events_received directory to start the workflow - Tests if the alert and children are well created - ''' - - - if os.path.isfile(TEST_FILE_PATH): - os.remove(TEST_FILE_PATH) - print("================== DELETE FILE ==================") - time.sleep(3) - - print("================== COPY FILE ==================") - shutil.copyfile(os.path.join(VOEVENTS_TO_SEND_PATH, TEST_FILE), - TEST_FILE_PATH) - time.sleep(4) - - self.assertEqual(Alert.objects.count(), 1) - alert = Alert.objects.all()[0] - self.assertEqual(alert.author, "ivo://nasa.gsfc.tan/gcn") - self.assertEqual(alert.burst_ra, 74.7412) - self.assertEqual(alert.burst_dec, 25.3137) - self.assertEqual(alert.trig_id, 532871) - self.assertEqual(alert.editor, "61") - self.assertEqual(alert.pkt_ser_num, 1) - - self.assertEqual(Request.objects.count(), 1) - self.assertEqual(Sequence.objects.count(), 2) - self.assertEqual(Album.objects.count(), 3) - self.assertEqual(Plan.objects.count(), 6) - - - - def test_basic(self): - ''' - Used to test scripts/celery_test.sh - Only work if the initial_fixture is on the celery test DB (an only it) - ''' - Country.objects.create(name="TEEEEST") - self.assertEqual(Country.objects.count(), 2, "should be 2 countries") + +# class AlertListenerTestsCelery(TestCase): +# ''' +# IMPORTANT : As soon as you do a DB request in a test, the test DB will no longer be synchronized with the DB used by celery +# I have no idea why (Paul), but any call to the DB must be done in setup or after all celery actions are finished +# ''' +# +# def test_alert_reception(self): +# ''' +# Must be launched with scripts/celery_test.sh +# Copy a VOEvent file in the events_received directory to start the workflow +# Tests if the alert and children are well created +# ''' +# +# +# if os.path.isfile(TEST_FILE_PATH): +# os.remove(TEST_FILE_PATH) +# print("================== DELETE FILE ==================") +# time.sleep(3) +# +# print("================== COPY FILE ==================") +# shutil.copyfile(os.path.join(VOEVENTS_TO_SEND_PATH, TEST_FILE), +# TEST_FILE_PATH) +# time.sleep(4) +# +# self.assertEqual(Alert.objects.count(), 1) +# alert = Alert.objects.all()[0] +# self.assertEqual(alert.author, "ivo://nasa.gsfc.tan/gcn") +# self.assertEqual(alert.burst_ra, 74.7412) +# self.assertEqual(alert.burst_dec, 25.3137) +# self.assertEqual(alert.trig_id, 532871) +# self.assertEqual(alert.editor, "61") +# self.assertEqual(alert.pkt_ser_num, 1) +# +# self.assertEqual(Request.objects.count(), 1) +# self.assertEqual(Sequence.objects.count(), 2) +# self.assertEqual(Album.objects.count(), 3) +# self.assertEqual(Plan.objects.count(), 6) +# +# +# +# def test_basic(self): +# ''' +# Used to test scripts/celery_test.sh +# Only work if the initial_fixture is on the celery test DB (an only it) +# ''' +# Country.objects.create(name="TEEEEST") +# self.assertEqual(Country.objects.count(), 2, "should be 2 countries") diff --git a/src/pyros/__init__.pyc b/src/pyros/__init__.pyc deleted file mode 100644 index 290dee9..0000000 Binary files a/src/pyros/__init__.pyc and /dev/null differ -- libgit2 0.21.2