Граф коммитов

298 Коммитов

Автор SHA1 Сообщение Дата
Cameron Dawson f6be2c334c added unit tests 2019-08-27 08:34:18 -04:00
ionutgoldan a5df8a966b
Bug 1346567 - Re enable Perfherder data cycler 2019-08-02 16:04:24 +03:00
Cameron Dawson c23fafb518
Revert "Bug 1346567 - Make dedicated cyclers" (#4854)
This reverts commit fa533ff25a.

Ends up there's a bug with this change. The plan is for @ionutgoldan to create a new PR with just the migration and model change for PerformanceDatum which we can deploy. Then he can re-implement his code changes from this PR and we'll already be done with the lengthy migration to add the index.
2019-04-02 15:28:57 -07:00
ionutgoldan fa533ff25a
Bug 1346567 - Make dedicated cyclers
Add index to performance_datum.push_timestamp field
Add more expire parameters for Perfherder data cycler
Don't keep perf data indefinitely
Have a debugger which logs even on production
2019-04-01 17:45:08 +03:00
Sebastian Hengst e84b3cd430 Bug 1530966 - Increase threshold for suggested bugs to be recent to 365 days (#4716) 2019-03-05 06:55:16 +00:00
Ed Morley e3e17266e6 Bug 1530267 - Remove use of Django's `smart_text` 2019-02-25 20:39:03 +00:00
Ed Morley d726fe7313 Bug 1530267 - Remove __future_ imports
Since they are a no-op on Python 3.
2019-02-25 20:39:03 +00:00
Ed Morley 681cc6d54f Bug 1527868 - Update tests to handle Elasticsearch not being configured
Whilst Treeherder itself correctly handled `ELASTICSEARCH_URL` not being
set, the tests were dependant on the availability of Elasticsearch.
2019-02-14 21:10:21 +00:00
George Hickman 63226ddc3c Replace BugJobMap.objects.create() with BugJobMap.create()
Whenever we create a BugJobMap with a User we want to update its Job's
best FailureClassification's Bug number with the one the BugJobMap was
created with.  This keeps the autoclassify data (FailureClassification)
in sync with BugJobMap.

However, doing this via an overridden `.save()` effectively hides the
functionality from anyone reading through the code.  Since the
`.update_autoclassification_bug()` method is only called from that one
place this moves all the functionality into the classmethod `.create()`.
This makes it explicit that creating a BugJobMap involves more than a
simple DB row creation.
2018-09-06 16:41:48 +01:00
George Hickman d36bb8ab76 Bug 1469777 - Fix FTS search query sanitising 2018-07-03 11:45:54 +01:00
George Hickman 4556e20ccb Get best_classification and best_is_verified from TextLogErrorMetadata
Since we can use TextLogErrors in most of the tests this allows us to
also remove all the zips combining FailureLines and TextLogErrors.
2018-06-20 02:57:33 -07:00
George Hickman f6617ec460 Pull mark_best_classification into auto-classification
This method was exclusively used in auto-classification making it better
suited to live there.  As an added benefit we can remove some complexity
because we know all TextLogError instances in auto-classification have
related FailureLines.
2018-06-07 10:25:37 +01:00
George Hickman 4dd71e0f1f
Consolidate *Match Models (#3598)
* Remove unused methods

* Use TextLogError.set_classification instead of FailureLine's version since they're the same effective code it's better to have a single entry point.

* Remove FailureLine.mark_best_classification_verified for TextLogError's to create a single place to mark a classification as verified.

* Get related FailureLine in a clearer way

* Only save changed fields

* Use decorator form of transaction.atomic to avoid extra indentation

* Use count on QuerySets instead of len since len() triggers a DB query and then counts the objects in memory while .count() triggers a query returning the result.

* Pull classified failure we're comparing against out into a variable

* Get objects from the db instead of refreshing in place

* Remove use of FailureMatch object/relation in favour of TLEMatch

* Manually build the matches output for the failure lines API

* Pull expected object out of list

* Manually build the classified failures output for the failure lines API
2018-06-01 12:19:27 +01:00
George Hickman 2b2844e545 Switch to *Match.matcher_name field
This also removes the Detectors since it wasn't possible to do them
separately.
2018-05-29 14:58:52 +01:00
George Hickman ba0d8550b0 Switch to using matcher_name 2018-05-29 14:58:52 +01:00
George Hickman 94f7c3aaa0 Assign ClassifiedFailures to *Match instances directly with ID 2018-05-18 08:51:11 +01:00
George Hickman b787f78cce Move tests to internal ES wrapper 2018-04-24 15:45:48 +01:00
George Hickman e34c8ed2fb Replace refreshing an index with internal ES wrapper 2018-04-24 15:45:48 +01:00
Ed Morley a33a22cd1f Bug 1452212 - Don't use len() to check if sequences are empty
Fixes pylint `len-as-condition`.
2018-04-10 20:10:27 +01:00
George Hickman 37bd9fe649 Bug 1428045 - Add future imports to turn print statements into functions 2018-03-21 11:56:27 +00:00
George Hickman f7d97026a9 Bug 1428045 - Mark string as raw
This stops occurrences of `\u` (such as in Windows paths) being
interpreted as malformed Unicode points.
2018-03-21 11:56:27 +00:00
George Hickman 9cdeb4665a Bug 1428045 - Convert print statments to print functions 2018-03-21 11:56:27 +00:00
Sarah Clements 4db1aa4210 Bug 1367362 - Model changes to support intermittents view (#3182)
change BugJobMap bug_id field to foreign key field to create a join on
Bugscache model; add whiteboard to bugzilla, add index to Push time
field for search by date range; update associated tests
2018-02-16 18:09:08 +00:00
Ed Morley 82f2b2fe9d
Bug 1346567 - Temporarily disable perfherder data cycling (#3022)
Since it's timing out due to missing indexes, preventing the rest of
the jobs data cycling from taking place (resulting in disk space
usage alerts).
2017-12-06 15:42:31 +00:00
Ed Morley bc0ca97102
Bug 1419965 - Remove the estimated job time remaining backend (#2990)
The UI has already been removed. This cleans up the data ingestion
and removes the `JobDuration` model, however leaves the `running_eta`
field on the `Job` model for the next time that table is touched (since
the table is large, so altering the schema would likely require
downtime).
2017-12-04 22:09:38 +00:00
camd 5cb083ee13 Bug 1215587 - Follow-up to transition over to new job.job_group (#2607) 2017-08-28 11:25:38 -07:00
Alisha Aneja 5cdc2170cc Bug 1223883 - Fix pytest warnings for test collection (#2717)
pytest treats objects starting with the string "Test" as tests, so an
underscore prefix has been added to prevent warnings of form:

```
WC1 .../test_detect_intermittents.py cannot collect test class 'TestFailureDetector' because it has a __init__ constructor
```
2017-08-22 15:10:58 +01:00
Max Chehab c6e0c26bc8 Bug 1336272 - Refactor changing wording from resultset to push (#2644)
Change of new environment variable `PULSE_PUSH_SOURCES`.

Keep old `publish-resultset-runnable-job-action` task name by creating a 
method that points to `publish_push_runnable_job_action`.
2017-08-04 09:38:57 -07:00
KWierso 3e9e7443cb Bug 1375341 - Add support for leaksanitizer errors (#2587) r=emorley 2017-06-29 17:05:26 -07:00
KWierso 37cf7fa970 Bug 1286195 - Add 'mozalloc_abort' to the bug suggestions blacklist (#2483) r=emorley 2017-05-16 15:01:51 -07:00
Ed Morley 9dad6fec61 Bug 1340554 - Switch away from deprecated Elasticsearch count API
The count search type was deprecated in Elasticsearch 2.0.0 and has been
removed entirely in version 5+:
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_search_changes.html

This switches to the `.count()` API instead:
https://elasticsearch-dsl.readthedocs.io/en/latest/api.html#elasticsearch_dsl.Search.count

This can be landed prior to the ES 5.x upgrade, since it's supported by
the ES 2.x API too.
2017-04-19 14:06:34 +01:00
Ed Morley 04945524a2 Update test_search.py for changes in elasticsearch-dsl 2.2.0
Since missing strings fields now return `None` not the empty string:
https://github.com/elastic/elasticsearch-dsl-py/blob/2.x/Changelog.rst#220-2016-11-04
19649863ea
2017-04-19 13:48:32 +01:00
James Graham ac04d5ab8c Bug 1349617 - Handle process output lines in the log parser.
Process output lines start with a prefix like GECKO(1234) or PID 1234
and then a pipe. This is an extra pipe symbol compared to other lines,
so our code that splits on | and assumes specific data in specific
positions is broken. Try to detect the process output case and discard
the first token so that we have the same fields as other
pipe-delimited data.
2017-03-23 14:39:10 +00:00
Ed Morley 4c66f383ef Bug 1348375 - Remove unused imports
Fixes:

tests/autoclassify/test_classify_failures.py:7:1: F401 'treeherder.model.models.TextLogErrorMetadata' imported but unused
tests/etl/test_job_loader.py:7:1: F401 'treeherder.model.models.Repository' imported but unused
tests/model/test_classified_failure.py:6:1: F401 'treeherder.model.models.FailureLine' imported but unused
tests/seta/conftest.py:2:1: F401 'django.utils.timezone' imported but unused
tests/seta/test_job_priorities.py:8:1: F401 'treeherder.seta.settings.SETA_LOW_VALUE_PRIORITY' imported but unused
tests/webapp/api/test_text_log_summary_lines.py:4:1: F401 'treeherder.model.models.TextLogError' imported but unused
treeherder/auth/backends.py:13:5: F401 'django.utils.encoding.smart_str as smart_bytes' imported but unused
treeherder/autoclassify/tasks.py:4:1: F401 'django.conf.settings' imported but unused
treeherder/autoclassify/tasks.py:6:1: F401 'treeherder.celery_app' imported but unused
treeherder/perfalert/__init__.py:1:1: F401 '.perfalert.*' imported but unused
treeherder/seta/analyze_failures.py:7:1: F401 'treeherder.etl.seta.valid_platform' imported but unused
treeherder/seta/job_priorities.py:10:1: F401 'treeherder.model.models.Repository' imported but unused
treeherder/seta/models.py:7:1: F401 'treeherder.model.models.Repository' imported but unused

The seta migrations file change is due to the seta models no longer
depending on `model` (since the unnecessary `Repository` import has
been removed).
2017-03-20 13:18:14 +00:00
William Lachance 73670ac626 Bug 1329742 - Expire performance data (with option to override) (#2084)
In most cases, but not all, we want to expire performance datum on the
same cadence as job data. Add some code to do this, with an optional
override to keep it around indefinitely for some cases.
2017-03-10 15:35:25 -05:00
William Lachance 1a19c1601a Bug 1328453 - Only use completed jobs for calculating average job duration
Completed jobs = those with an end time > start_time
2017-03-06 11:36:00 -05:00
William Lachance fe5742a236 Bug 1328453 - Re-add accidentally deleted unit test for calculating durations 2017-03-06 11:36:00 -05:00
jgraham 3c03bb9fba Bug 1321787 - Autoclassify through the TextLogError rather than through the FailureLine (#2179) 2017-03-04 20:58:31 +00:00
Ed Morley 390cf3afc7 Bug 1333092 - Fix flake8 E305: expected 2 blank lines after definition
tests/client/test_treeherder_client.py:514:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:66:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:94:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:112:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:148:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:166:1: E305 expected 2 blank lines after class or function definition, found 1
tests/perfalert/test_analyze.py:94:1: E305 expected 2 blank lines after class or function definition, found 1
tests/webapp/api/test_auth.py:23:1: E305 expected 2 blank lines after class or function definition, found 1
tests/webapp/api/test_version.py:12:1: E305 expected 2 blank lines after class or function definition, found 1
treeherder/config/settings.py:21:1: E305 expected 2 blank lines after class or function definition, found 1
treeherder/credentials/admin.py:10:1: E305 expected 2 blank lines after class or function definition, found 0
treeherder/etl/schema.py:16:1: E305 expected 2 blank lines after class or function definition, found 1
treeherder/model/search.py:56:1: E305 expected 2 blank lines after class or function definition, found 1
treeherder/model/tasks.py:42:1: E305 expected 2 blank lines after class or function definition, found 1
2017-01-23 16:30:24 +00:00
William Lachance 012df34580 Bug 1329002 - Remove last pieces of and references to datasource 2017-01-06 15:01:19 -05:00
William Lachance ae0be9d81c Bug 1329002 - Remove jobs model 2017-01-06 15:01:19 -05:00
William Lachance f6407b7493 Bug 1318474 - Stop writing to datasource altogether for jobs data
The last thing we were using it for were cycling data and giving an
id numbering for jobs, and we can easily replace those with calls to
the ORM.
2017-01-05 16:09:51 -05:00
William Lachance 901f6288a5 Bug 1318474 - Rewrite unit tests to only look for ORM representation 2017-01-05 16:09:51 -05:00
William Lachance 78f66bc7c5 Bug 1328451 - Add a mock log parser fixture to cycle data test
Prevents an intermittent from popping up
2017-01-04 12:32:21 -05:00
William Lachance 32cfd2b659 Bug 1318474 - Make web api's use ORM ids as input and output 2016-12-28 15:42:12 -05:00
William Lachance 608afa4ebd Bug 1325540 - Fix setting expected job duration during ingestion (#2042) 2016-12-28 11:13:50 -05:00
William Lachance ddd9b13eef Bug 1265503 - Add a reference to the main db job objects from performance datum 2016-12-20 17:37:35 -05:00
William Lachance 931865befe Bug 1265503 - Move data cycling tests into their own file 2016-12-20 17:37:35 -05:00
William Lachance 0f10dff26a Bug 1301477 - Convert artifact model into a set of etl methods (#2013) 2016-12-20 13:10:57 -05:00
Ed Morley da7902aa75 Bug 1320356 - Remove the custom DB-based Celery taskset implementation
Since it's unused as of bug 1310974.
2016-12-02 16:25:24 +00:00