зеркало из https://github.com/mozilla/treeherder.git
Bug 1637382 - Fix extract test (#6416)
* ensure debugging is off * fix extract test * update requirements Co-authored-by: Kyle Lahnakoski <kyle@lahnakoski.com>
This commit is contained in:
Родитель
3d0f3c0892
Коммит
af41934af9
|
@ -267,14 +267,14 @@ mo-kwargs==3.54.20059 \
|
|||
mo-logs==3.66.20113 \
|
||||
--hash=sha256:49d99312f35e84db47e48897b3d61e4abc1c6419868025eab827c3f57ff53480 \
|
||||
# via jx-bigquery, jx-mysql, jx-python, mo-collections, mo-files, mo-http, mo-json, mo-json-config, mo-kwargs, mo-math, mo-sql, mo-testing, mo-threads, mo-times
|
||||
mo-math==3.57.20089 \
|
||||
--hash=sha256:e2880178fb9ebeb6bda5a2e62d36f2fa0c47a3cfcf73b4269e116954d26e75d5 \
|
||||
mo-math==3.69.20133 \
|
||||
--hash=sha256:2d54ee7c8790166a45ce1400b2312b35ac1cd1ad2c16d4b88d84a6603ba291c3 \
|
||||
# via jx-mysql, jx-python, mo-testing, mo-times
|
||||
mo-sql==3.55.20074 \
|
||||
--hash=sha256:de8b700d3b1a1b687fa0f7ae44ccd3141b8cb1df3d179ce692d3756b56cc1237 \
|
||||
# via jx-bigquery, jx-mysql
|
||||
mo-testing==3.58.20089 \
|
||||
--hash=sha256:2cd407e5a2d7a31abea93dc0e5c08f9d12e5e96d93d4658db47303d5b1ebaad1 \
|
||||
mo-testing==3.69.20133 \
|
||||
--hash=sha256:41013890db4e84660d8a13d8f43f01cf898f0120d3c097ceacb1dfe4ed10dfa8 \
|
||||
# via -r requirements/common.in
|
||||
mo-threads==3.57.20089 \
|
||||
--hash=sha256:e7993fad18fedee21e9152f0c4ae9ff92c346f7e34c3a409e184e962dba7f5dc \
|
||||
|
|
|
@ -151,13 +151,9 @@ def complex_job(
|
|||
}
|
||||
)
|
||||
|
||||
bcf = ClassifiedFailure.objects.create(
|
||||
**{
|
||||
"bug_number": 1234567,
|
||||
"created": Date("2020-01-17 12:00:00").datetime,
|
||||
"modified": Date("2020-01-17 12:00:00").datetime,
|
||||
}
|
||||
)
|
||||
bcf = ClassifiedFailure.objects.create(**{"bug_number": 1234567,})
|
||||
bcf.created = Date("2020-01-17 12:00:00").datetime
|
||||
bcf.save()
|
||||
|
||||
FailureLine.objects.create(
|
||||
job_log=job_logs1,
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import pytest
|
||||
from django.db.models import Q
|
||||
from mo_dots import listwrap
|
||||
|
||||
from jx_base.expressions import NULL
|
||||
from jx_mysql.mysql import MySQL
|
||||
from jx_mysql.mysql_snowflake_extractor import MySqlSnowflakeExtractor
|
||||
|
@ -99,7 +101,6 @@ def test_django_cannot_encode_datetime_strings(extract_job_settings):
|
|||
list(source.query(sql_query, stream=True, row_tuples=True))
|
||||
|
||||
|
||||
@pytest.mark.skip("Bug 1637366 - There is timezone intermittent issues on Travis")
|
||||
def test_extract_job(complex_job, extract_job_settings, now):
|
||||
source = MySQL(extract_job_settings.source.database)
|
||||
extractor = MySqlSnowflakeExtractor(extract_job_settings.source)
|
||||
|
@ -112,14 +113,21 @@ def test_extract_job(complex_job, extract_job_settings, now):
|
|||
|
||||
doc = acc[0]
|
||||
doc.guid = complex_job.guid
|
||||
doc.last_modified = complex_job.last_modified
|
||||
|
||||
assertAlmostEqual(
|
||||
acc, JOB, places=3
|
||||
) # TH MIXES LOCAL TIMEZONE WITH GMT: https://bugzilla.mozilla.org/show_bug.cgi?id=1612603
|
||||
acc,
|
||||
JOB,
|
||||
places=4, # TH MIXES LOCAL TIMEZONE WITH GMT: https://bugzilla.mozilla.org/show_bug.cgi?id=1612603
|
||||
)
|
||||
|
||||
|
||||
EXTRACT_JOB_SQL = (File(__file__).parent / "test_extract_job.sql").read()
|
||||
|
||||
JOB = (File(__file__).parent / "test_extract_job.json").read_json()
|
||||
JOB.job_group.description = NULL # EXPECTING NOTHING
|
||||
|
||||
for j in JOB:
|
||||
j.last_modified = Date.now()
|
||||
for l in listwrap(j.job_log):
|
||||
for f in listwrap(l.failure_line):
|
||||
f.best_classification.modified = Date.now()
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
"show_foreign_keys": false,
|
||||
"null_values": ["-", "unknown", ""],
|
||||
"add_relations": [
|
||||
"job.option_collection_hash -> option_collection.option_collection_hash",
|
||||
"text_log_error.step_id -> text_log_step.id"
|
||||
"job.option_collection_hash -> option_collection.option_collection_hash"
|
||||
],
|
||||
"name_relations": {
|
||||
"job\\.option_collection_hash -> option_collection\\.option_collection_hash": "options"
|
||||
|
|
Загрузка…
Ссылка в новой задаче