AlexsLemonade / refinebio

Refine.bio harmonizes petabytes of publicly available biological data into ready-to-use datasets for cancer researchers and AI/ML scientists.
https://www.refine.bio/
Other
128 stars 19 forks source link

Fix test_foreman failing job #3203

Closed arkid15r closed 1 year ago

arkid15r commented 1 year ago

Context

In order to restore staging/prod deploy process CI/CD tests need to be fixed.

Problem or idea

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 21 column 1 (char 20)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/data_refinery_foreman/foreman/management/commands/update_experiment_metadata.py", line 78, in handle
    parsed_json = experiment_request.json()["experiments"]["experiment"][0]
  File "/usr/local/lib/python3.8/dist-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 21 column 1 (char 20)
F./usr/local/lib/python3.8/dist-packages/django/db/models/fields/__init__.py:1358: RuntimeWarning: DateTimeField Experiment.source_first_published received a naive datetime (2017-11-30 00:00:00) while time zone support is active.
  warnings.warn("DateTimeField %s.%s received a naive datetime "
/usr/local/lib/python3.8/dist-packages/django/db/models/fields/__init__.py:1358: RuntimeWarning: DateTimeField Experiment.source_last_modified received a naive datetime (2017-11-30 00:00:00) while time zone support is active.
  warnings.warn("DateTimeField %s.%s received a naive datetime "
./usr/local/lib/python3.8/dist-packages/django/db/models/fields/__init__.py:1358: RuntimeWarning: DateTimeField Experiment.source_first_published received a naive datetime (2013-07-19 00:00:00) while time zone support is active.
  warnings.warn("DateTimeField %s.%s received a naive datetime "
/usr/local/lib/python3.8/dist-packages/django/db/models/fields/__init__.py:1358: RuntimeWarning: DateTimeField Experiment.source_last_modified received a naive datetime (2015-06-22 00:00:00) while time zone support is active.
  warnings.warn("DateTimeField %s.%s received a naive datetime "
.2023-02-11 04:39:58,760 local data_refinery_foreman.foreman.job_control INFO [num_to_clean: 1]: Cleaning unsynced files!
2023-02-11 04:39:58,763 local data_refinery_foreman.foreman.job_control INFO: Cleaned files!
.
======================================================================
FAIL: test_array_express_experiment_missing_metadata (tests.foreman.management.commands.test_update_experiment_metadata.SurveyTestCase)
Tests that an ArrayExpress experiment has its missing metadata added.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/tests/foreman/management/commands/test_update_experiment_metadata.py", line 125, in test_array_express_experiment_missing_metadata
    self.assertNotEqual(
AssertionError: 'GEO accession GSE1337 is currently private and is scheduled to be released on Jan 01, 1970.' == 'GEO accession GSE1337 is currently private and is scheduled to be released on Jan 01, 1970.'

Solution or next step

Resolve the specific test case failure.

arkid15r commented 1 year ago

This one is quite non-trivial as it needs a migration to new API endpoint.

arkid15r commented 1 year ago

Fixed by https://github.com/AlexsLemonade/refinebio/pull/3254