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

158 Коммитов

Автор SHA1 Сообщение Дата
William Lachance b035647fe2 Bug 1281820 - Remove all bug suggestion artifact storage code + tests (#1927) 2016-10-18 11:32:52 -04:00
William Lachance 8fc9754f4e Bug 1281820 - Stop using bug suggestions artifacts
Instead, generate the data when required. We will store the return value
of this in memcache for a day to ensure things are responsive for the sheriffs
when classifying recent failures.
2016-10-07 10:51:41 -04:00
William Lachance 69bdc2ed15 Bug 1281820 - Clean up autoclassification unit tests
* Remove unused fixtures
* Add test_job, test_job_2 fixtures for testing job data, instead of
  ingesting 11 jobs
* Remove various uses of datasource
2016-10-07 10:51:41 -04:00
William Lachance f0105d47f5 Bug 1258861 - Move text log steps and errors into main database (#1696)
This changes ingestion, the API endpoints, and the frontend to match
the new structure. For now we continue to store text_log_summary artifacts,
though they don't do anything anymore.
2016-09-12 12:30:36 -04:00
William Lachance 277b3c3b7a Bug 1178395 - Remove active status from most reference data tables (#1809)
The field is never updated or used in anything but repository, so let's just
take them out for now.
2016-08-26 13:45:55 -04:00
Ed Morley de761c8441 Bug 1285923 - Remove unused mock_fetch_json fixture
Bug 1280910 made the bug suggestions generation during log parsing no
longer hit the bugscache Treeherder API, so we no longer need to mock
the request to it.

Any future uses of `fetch_json()` during tests would be better mocked
using the responses library instead.
2016-07-11 20:45:51 +01:00
William Lachance 91282c972b Bug 1285521 - Generate correct values for manually-generated alerts 2016-07-08 14:45:38 -04:00
Ed Morley ea5194f486 Bug 1284853 - Skip creating a user in the client_credentials fixture
Since Hawk credentials can now be created without an owner, there's no
need for this fixture to create a user to be associated with the test
Hawk credentials, since none of the tests using the `client_credentials`
fixture actually use the created user.

The `transactional_db` fixture is now required since it's no longer
inherited from the `test_user` fixture.

Also switch back to `.create()` rather than `.get_or_create()` now that
bug 1133273 is fixed.
2016-07-07 23:29:42 +01:00
jgraham b040bb4045 Bug 1281056 - Stop using http calls when storing job data (#1640) 2016-07-05 22:15:52 +01:00
Shruti Jasoria 082b6f0fae Bug 1273983 - Allow enabling/disabling a performance framework (#1620) 2016-07-04 11:08:07 -04:00
jgraham 52607c2a57 Bug 1268484 - Add elastic-search based matcher for test failure lines (#1488)
Add support for matching test failures where the test, subtest, status,
and expected status are all exact matches, but the message is not an
exact match. The matching uses ElasticSearch and is initially optimised
for cases where the messages differ only in numeric values since this is
a relatively common case.

This commit also adds ElasticSearch to the travis environment.
2016-06-29 11:25:38 +01:00
William Lachance f86dae6e61 Bug 1282907 - Fix named models to be more sane (#1624)
* Remove unused members from NamedModel (define in subclass where really
  needed)
* Enforce uniqueness on name properties
2016-06-28 17:00:42 -04:00
Ed Morley 75997d5ccb Bug 1279213 - Python client: Combine _get_uri and _get_project_uri
Since they are virtually identical, and downstream consumers (eg
`_get_json()`) are having to check for the presence of `project` to
figure out which to call.
2016-06-23 09:47:46 +01:00
Ed Morley ad4d364d91 Bug 1279213 - Python client: Remove the per-method timeout parameters
The `timeout` parameter to requests.{get,post} only control the timeout
waiting for a response to the socket, and not the total request time. As
such, it doesn't really make sense to want to specify different timeouts
for different API requests (since the time to connect should be similar,
even if one API request is more time-consuming to generate overall).

This commit removes the per-method timeout argument, leaving the
TreeherderClient constructor as the single place to control the timeout.
2016-06-23 09:47:46 +01:00
Ed Morley 8018695367 Bug 1245158 - Send auth headers for Python client GETs too
Previously, if the `client_id` and `secret` were set, the Hawk auth
headers would only be sent for requests using `_post_json()`. Now they
will also be sent when using `_get_json()` too.

This change means:
1) For users already setting `client_id` & `secret` for GET-based client
functionality, we can more easily tell from where requests are coming
(since transactions in New Relic are annotated with the `client_id`).
2) In the future bug 1203556 can implement rate limiting for GETs too,
with higher thresholds for authenticated users.
2016-06-16 00:14:48 +01:00
William Lachance e824b69249 Bug 1260805 - Make performance bug template configurable per-project (#1579)
Do this by storing the content of each template in the database (currently
we have just one, for Talos) and adding an API endpoint for fetching it.
For now, we will store the data that should be in each template in a
pre-loaded fixture. Bonus new feature: automatic population of a "CC" list.
2016-06-09 12:50:54 -04:00
James Graham 9e4a8db518 Bug 1277936 - Fix indentation issue that made update_autoclassification_bug a no-op.
This wasn't a serious issue, it just meant that we would never infer a bug
number when a job was sheriffed using the non-autoclassification UI.
2016-06-06 11:54:45 +01:00
William Lachance bede7c1390 Bug 1260791 - Add API's for creating performance alerts + alert summaries 2016-05-31 19:54:49 -04:00
William Lachance 11bb8a0a8a Bug 1260791 - Refactor and improve performance alert unit tests 2016-05-30 15:07:23 -04:00
Ed Morley b6677fd5c6 Bug 1276254 - Remove unnecessary usage of .read() when json decoding
By using `json.load()` instead of `json.loads()` we can pass the file
object directly, rather than having to `.read()` it first.
2016-05-27 18:24:38 +01:00
Ed Morley 886022e024 Bug 1240809 - Switch BzAPIBugProcess to using fetch_json 2016-05-27 11:46:26 +01:00
James Graham 4152930b0f Bug 1271598 - Classifier for matching crashes with identical signatures 2016-05-11 14:40:40 +01:00
James Graham 8f3016767a Bug 1271591 - Enable disabled autoclassification tests. 2016-05-10 11:39:07 +01:00
William Lachance 71f0af954e Bug 1269433 - Consolidate user creation in tests into fixtures 2016-05-02 14:24:21 -04:00
James Graham 496335e6c5 Bug 1265188 - Make sure to check for existing identical classification when trying to update the bug number.
When setting the bug number for a classified failure, first check for an
classified failure that already has that bug number, and if one exists,
update all references to the classified failure being changed to instead
point at the existing classification
2016-04-29 17:17:25 +01:00
James Graham 7e4084d24f Bug 1252854 - Backend work for matching unstructured and structured log summary lines. 2016-04-19 19:16:08 +01:00
Cameron Dawson 6ce43bf034 Bug 1177519 - Back end changes for autoclassification work 2016-04-19 19:16:07 +01:00
William Lachance 3bf0fefd0f Bug 1251845 - Only generate performance alerts on specific repositories
Make a repository property on whether we should generate performance alerts,
default to false.
2016-04-12 13:01:03 -04:00
William Lachance 92f02ccc25 Bug 1231361 - Remove refdata model dependency from unit tests 2016-04-04 15:10:08 -04:00
William Lachance 70e00bc6da Bug 1260110 - Add a "has subtests" property to performance series
This will be useful for some views where we don't know off the bat
whether a signature has subtests or not (e.g. the e10s dashboard,
the graphs view) and thus whether to show a "show subtests button"
2016-03-30 16:21:57 -04:00
Cameron Dawson 41522044fd Bug 1199291 - Create result set on the fly for jobs ingested where the RS does not exist yet 2016-03-23 16:56:52 -07:00
Cameron Dawson 2a9dbefa49 Bug 1199364 - Use revsion instead of revision_hash for resultsets
New resultsets will still store a value in their ``revision_hash`` field, but it will
just be the same value as their ``long_revision`` field.

This will log an exception in New Relic when a new resultset or job is posted
to the API with only a ``revision_hash``and not a ``revision`` value.

This also switches to using the longer 40 char revisions along side the
12 char revisions.  But we leverage the longer ones for most actions.  The
short revisions are stored and used so that people and the UI can support
locating a resultset (or setting ranges) with short revisions.
2016-03-17 15:48:49 -07:00
William Lachance ecac73e26a Bug 1256485 - Don't load initial data in unit tests
It's almost entirely unnecessary (the few times we need base data
we can generate it ourselves) and can overwrite other test data
if we're not careful. Better just to remove it.
2016-03-16 14:47:39 -04:00
James Graham 326b918e35 Bug 1245080 - Remove failure lines with corresponding jobs
When jobs are cycled, also remove the failure_line rows for
those jobs, to limit data consumption of the failure_line
table.
2016-03-16 17:25:54 +00:00
William Lachance f19d24fba9 Bug 1207648 - Remove temporary migration code and schemas
* We needed to allow the respository and last_updated fields to be null
  temporarily while we waited to run a migration, but this is no longer
  necessary
* Also remove temporary migration script, it's no longer needed
2016-03-09 18:20:11 -05:00
Cameron Dawson 5d3399e9ac Bug 1254673 - return resultset info when on API submission
This returns some basic info about the resultsets that were submitted via a POST to the API.
This is needed for Task Cluster as we transition away from ``revision_hash`` so that they
take it from us, instead of using what they submit.  This way, we can return them the
``revision_hash`` that we WANT to be moving to (PR 1322).  They also need this so they can
then send that new ``revision_hash`` to the tasks (jobs) that belong to it.
2016-03-09 11:47:28 -08:00
Cameron Dawson 26b156af5a Bug 1254673 - Stop posting new resultset info to pulse 2016-03-09 11:47:28 -08:00
Ed Morley 388a4d6af0 Bug 1248406 - Correct syntax of imports that are actually relative paths
In Python 2 you can get away with using relative paths for imports
without the dot syntax. However it's best practice to use it when the
import path is relative to the current directory rather than the project
root. This also makes it Python 3 compatible.
2016-02-15 14:54:45 +00:00
Ed Morley 17b514d32e Bug 1212937 - Remove support for passing `auth` to the Python client
The `auth` parameter was intended to receive either a `TreeherderAuth`
instance (for OAuth credentials), or a `HawkAuth` instance. The former
no longer exists since OAuth support has been removed, and the latter is
not necessary, since the client now supports simply passing `client_id`
and `secret` to the `TreeherderClient` constructor, as a simpler way of
specifying the Hawk credentials. As such, the `auth` parameter is
superfluous and can be removed.
2015-12-16 18:17:58 +00:00
Ed Morley 61d596267a Bug 1212937 - Remove API support for OAuth credentials
Since they are deprecated and all submitters have switched over to using
Hawk credentials instead.

The automatically created migrations file was edited to remove the
unused `models` import, since otherwise flake8 complains. We could
alternatively exclude the migrations directory from flake8, however we
would then miss linter errors in any hand-written migrations files.

In addition, Django have fixed the issue in 1.9:
a7bc00e17b
2015-12-16 18:12:41 +00:00
Ed Morley ca53f80f81 Bug 1232654 - Update requests-hawk from v0.2.0 to v1.0.0
v1.0.0 has a simplified API for passing the id and key, see:
https://github.com/mozilla-services/requests-hawk#great-how-can-i-use-it

https://github.com/mozilla-services/requests-hawk/blob/master/CHANGES.txt
https://github.com/mozilla-services/requests-hawk/compare/0.2.0...1.0.0
2015-12-16 14:45:36 +00:00
Ed Morley 429feea9f7 Bug 1230610 - Rename get_remote_content to fetch_json
Since it's returning json specifically, and in the future we'll have
another function in that file for fetching text content too.
2015-12-11 10:45:25 -05:00
William Lachance b6908b2140 Bug 1228156 - Backend work for updating performance alerts
Specifically, this update creates an API endpoint that allows updating a
"revised" summary id property off each alert. This is intended for the case
where a performance alert was generated against the wrong summary (usually
because of a downstream merge between branches). For now, the API requires the
user to be staff (i.e. a sheriff), otherwise it will generate a 403 denied.
2015-12-09 10:20:51 -05:00
Ed Morley c89fc00502 Bug 1196764 - Add the test_repository fixture to tests that store jobs
At the moment tests that store jobs can get away with not having the
test project listed in the repository table. However with later commits,
the new job_duration table will have a foreign key on the repository
table, which will break those tests unless they use the test_repository
fixture, which creates the repository record for them.
2015-11-30 11:36:19 +00:00
Ed Morley bc43f09637 Revert "Add integration between autoclassification and manual starring."
This reverts commit 67b335f4c5.
2015-11-02 09:50:25 +00:00
Mauro Doglio 5930b4f4c1 Bug 1193836 - Use pytest-django to run tests
pytest-django doesn't setup a test database for every single test, but
only for those tests that actually require a db. Tests that require a db
need to either be marked with `@pytest.mark.django_db` or use a fixture
that has a dependency on `db` or `transactional_db`.
Using a non transactional db would make tests execution much faster, but
unfortunately it doesn't play well with the treeherder datasource
creation so I used a transactional_db.

pytest-django also allows you to specify a settings file to use for
tests in a pytest.ini file, which is nicer than monkeypatch the original
settings file in the pytest session start function 😃.
2015-10-27 11:19:13 +00:00
Mauro Doglio 95dbd99410 Bug 1193836 - Stop using init_master_db for tests setup 2015-10-27 11:18:29 +00:00
Mauro Doglio d5f847e559 Bug 1193836 - Decouple the jobs and reference databases for test
We were previously using the same database (test_treeherder) for both the
jobs and reference data model. I centralized the new db name in the test
settings file. All the test requiring the jobs db or its repository counterpart
can now access it using the `test_project` fixture, while utility functions use
directly the metioned setting. Where the project name is hardcoded in a static
file, I just replaced it with the new name `test_treeherder_jobs`
2015-10-27 11:18:29 +00:00
Mauro Doglio 6134f26b6d Bug 1193836 - Delete jobs test databases using fixture finalizer
This guarantees that jobs databases is dropped at the end of each
test. It also makes the jobs database life cycle easier to understand.

In general to keep the tests as fast as possible we shouldn't have much
code in the setup and tear down of each test.
2015-10-27 11:18:29 +00:00
Mauro Doglio 247cc3de64 Bug 1193836 - Use a dedicated settings file for testing 2015-10-27 11:18:19 +00:00