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

92 Коммитов

Автор SHA1 Сообщение Дата
Ed Morley f6ecbdd8b6
Bug 1528811 - Remove job-collection related classes from thclient (#4661)
These were formerly used when submitting job data using the Python client
(support for which was removed in bug 1349182), and in `buildapi.py` as
part of buildbot ingestion (until #4087 / bug 1443251).

This removes the final usages in our tests so we can drop them entirely.
2019-02-20 06:49:54 +00:00
Ed Morley 4bdf9f9101 Bug 1526743 - Explicitly .decode() streamed log lines
Since the `request` package's `iter_lines()` returns bytes by default.

We cannot pass `decode_unicode=True` to `iter_lines()` since it splits on
Unicode newlines (which can exist in test message output), so instead we
manually `.decode()` each line before parsing it.

Fixes the following exception under Python 3:
`TypeError: a bytes-like object is required, not 'str'`

The test utility `load_exp()` had to be modified to no longer use append
mode when opening the expected output JSON files, in order to fix:
`json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`
2019-02-12 20:00:16 +00:00
Ed Morley 7060eef007
Bug 1527020 - Travis: Enable unit tests under Python 3 (#4619)
To help prevent regressions whilst the remaining xfailed tests are fixed.
2019-02-11 20:31:20 +00:00
Ed Morley 4cfdae3f41 Bug 1522101 - Use Prettier to format JSON 2019-01-23 20:19:04 +00:00
Ed Morley 445766d958
Bug 1443251 - Remove support for buildbot job ingestion (#4087)
The buildapi celerybeat tasks were disabled previously in #4007, so
these tasks are unused.
2018-10-02 11:07:27 +01:00
Ed Morley ecf4c4e33a
Bug 1349182 - Remove support for submitting jobs via the REST API (#4075)
Now that autophone and AWFY have migrated to Taskcluster, there are
no more submitters of jobs to the REST API (confirmed via New Relic
Insights). As such, this deprecated data ingestion method can now be
removed, along with support for API Hawk auth, API POST throttling
and `treeherder-client` job submission capability.

After this lands we'll need to manually drop the `credentials` table.
2018-09-28 02:17:48 +01:00
pyup.io bot 2647b998aa Update pytest to 3.8.0 (#3989)
* Update pytest from 3.7.4 to 3.8.0

* Fix django.core.urlresolvers deprecation warnings

The new version of pytest now correctly catches warnings that occur
within tests/fixtures, which has unearthed new Deprecation warnings
that need fixing to prevent test failures.

Prevents:
```
RemovedInDjango20Warning: Importing from django.core.urlresolvers is
deprecated in favor of django.urls.
```
2018-09-06 15:37:17 +01:00
George Hickman 9d29a26309 Replace uses of some_queryset.all()[0] with some_queryset.first() 2018-08-14 09:25:24 +01:00
Ed Morley a5023192e9
Bug 1453482 - Use d-r-f's APIClient instead of WebTest's TestApp (#3439)
To avoid unnecessary dependencies, and use a more conventional
django-rest-framework testing approach:
http://www.django-rest-framework.org/api-guide/testing/#apiclient

APIClient has a few API differences:
* `.json` -> `.json()`
* `.status_int` -> `.status_code`
* Get parameters are passed as keyword argument `data` not `params`
* The default hostname is `http://testserver` not `http://localhost`
* Additional HTTP headers are passed directly as keyword arguments,
  rather than nested under a `headers` property.
* It doesn't check the status code itself, so explicit checks are
  required, along with removing `expect_errors`.
* The `.post_json()` and `.put_json()` methods don't exist.

See also the docs for the Django test client (which APIClient wraps):
https://docs.djangoproject.com/en/1.11/topics/testing/tools/#the-test-client

Whilst making these changes, I also cleaned up the session fetching
in `test_auth.py` and `test_backends.py`, and added a `status_code`
check in `conftest.py`'s `mock_post_json()` - which makes the root
cause of test failures clearer.
2018-04-12 18:06:53 +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
Ed Morley f7f38ef4d0
Bug 1257602 - Remove support for revision_hash (#2983)
Now that no submissions are using revision_hash, it can be removed.
This removes everything but the model field, which will be handled
later.

I've removed revision_hash from the Pulse jobs schema without bumping
the version, which wouldn't normally be ok, but no one is still using
it, and I'd rather have explicit failures later than if we left the
schema unchanged.
2017-11-28 00:09:17 +00: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
Ed Morley 6717d9f5fc Bug 1165356 - Log parser: Fetch logs using requests instead of urllib2
Doing so also fixes incorrect line numbers in logs that have Windows
line endings (bug 1328880), hence having to update the expected logview
output.

The tests have to be adjusted to use responses, since requests doesn't
support `file://` URLs.
2017-03-22 00:50:02 +00:00
Ed Morley f4b37c026b Bug 1348375 - Stop using a wildcard import in treeherder.client
This import only affects internal treeherder usage, people using the
PyPI package import from the `thclient` subdirectory instead.

Fixes:

treeherder/client/__init__.py:1:1: F401 '.thclient.*' imported but unused
2017-03-20 13:18:20 +00:00
jgraham 184ba384f0 Bug 1312575 - Duplicate autoclassification information across TextLogError and FailureLine (#2178)
This adds a FailureLine foreign key to TextLogError and duplicates the
best_classification and best_is_verified columns. Classifications are
still set on FailureLine and copied to the corresponding column on
TextLogError.

This is a prelude to future work which will remove classifications from
FailureLine altogether, so that all autoclassification data can be
retrieved from TextLogError.
2017-02-28 14:26:50 +00:00
William Lachance ae0be9d81c Bug 1329002 - Remove jobs model 2017-01-06 15:01:19 -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 9d557622f7 Bug 1318474 - Add job metadata to ORM schema and start ingesting it (#1998) 2016-11-24 12:56:50 -05:00
jgraham 0e8f0572cd Revert "Bug 1312575 - Duplicate autoclassification information across TextLogError and FailureLine" (#1996) 2016-11-23 15:09:00 +00:00
jgraham 4da51949a0 Bug 1312575 - Duplicate autoclassification information across TextLogError and FailureLine (#1950)
This adds a FailureLine foreign key to TextLogError and duplicates the
best_classification and best_is_verified columns. Classifications are
still set on FailureLine and copied to the corresponding column on
TextLogError.

This is a prelude to future work which will remove classifications from
FailureLine altogether, so that all autoclassification data can be
retrieved from TextLogError.
2016-11-22 22:26:37 +00:00
William Lachance 129adcfab3 Bug 1301477 - Disable external facing artifact endpoints and API's (#1965)
* Can no longer store raw artifacts (anything treeherder doesn't understand
  is ignored)
* Attempting to retrieve an artifact now returns a 405 (not allowed)
2016-11-08 09:49:21 -05:00
William Lachance e6ef630d84 Bug 1311465 - Replace uses of django-memoize with django's default cache (#1937)
It turns out that django-memoize's behaviour is rather difficult to reason
about for common cases, so let's just use django's cache framework for now.
2016-11-01 13:10:06 -04:00
William Lachance b035647fe2 Bug 1281820 - Remove all bug suggestion artifact storage code + tests (#1927) 2016-10-18 11:32:52 -04:00
William Lachance 7e54cc25be Bug 1309521 - Don't cache empty bug suggestion lists (#1919)
It might be that they'll be updated later
2016-10-12 09:32:59 -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 28cae8c360 Bug 1302844 - Remove redundant information from text log artifacts (#1854)
Now that they are only an intermediary format, we can remove data
that isn't required to interpret them.
2016-09-21 10:54:53 -04:00
William Lachance 246e11b11d Bug 1301729 - Remove buildapi migration script 2016-09-15 10:02:51 -04:00
William Lachance 9ffb8c49b5 Bug 1258861 - Stop creating text log summary artifacts
We only kept creating them so we could revert, but things are looking
happy on stage and production so I don't think we'll need to do that.
2016-09-14 14:06:15 -04:00
William Lachance 7e4ec3423e Bug 1301729 - Store buildbot request id as a job detail 2016-09-12 13:07:29 -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
Shruti Jasoria 082b6f0fae Bug 1273983 - Allow enabling/disabling a performance framework (#1620) 2016-07-04 11:08:07 -04:00
William Lachance e2c92101df Merge pull request #1529 from wlach/1270629-3
Bug 1270629 - Remove migration code for job info -> detail change
2016-05-27 14:29:53 -04:00
William Lachance 477b464dd9 Bug 1270629 - Remove migration code for job info -> detail change 2016-05-27 14:17:01 -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
William Lachance 0e9d516f8a Bug 1273231 - Store job log url/name/parse information in central database 2016-05-25 13:58:44 -04:00
William Lachance aa0ceb6028 Bug 1270629 - Temporarily revert changes to remove job info artifact ingestion
We'll continue ingesting these artifacts in parallel with the jobdetail
objects, to make sure we can revert cleanly if something breaks.
2016-05-09 20:09:26 -04:00
William Lachance 82221633b8 Bug 1270629 - Replace Job Info artifacts with a "jobdetail" endpoint
This is simpler and removes one more type of artifact from the per-project
databases.
2016-05-09 20:09:26 -04:00
William Lachance 5e8e6d12a3 Revert "Bug 1270629 - Replace Job Info artifacts with a "jobdetail" endpoint"
This reverts commit af9c208792.
2016-05-09 16:08:26 -04:00
William Lachance 7cb214306d Revert "Bug 1270629 - Temporarily revert changes to remove job info artifact ingestion"
This reverts commit 238fc614c5.
2016-05-09 16:08:22 -04:00
William Lachance 238fc614c5 Bug 1270629 - Temporarily revert changes to remove job info artifact ingestion
We'll continue ingesting these artifacts in parallel with the jobdetail
objects, to make sure we can revert cleanly if something breaks.
2016-05-09 14:51:42 -04:00
William Lachance af9c208792 Bug 1270629 - Replace Job Info artifacts with a "jobdetail" endpoint
This is simpler and removes one more type of artifact from the per-project
databases.
2016-05-09 14:51:42 -04:00
William Lachance b69d2e4515 Bug 1263691 - Remove talos parsing/processing code from Perfherder
It's no longer needed now that Talos only submits generic Perfherder artifacts
2016-04-13 16:27:12 -04: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
William Lachance f99e43e682 Bug 1251618 - Allow multiple perfherder artifacts in log files
Also can now pass a list of performance artifacts via the client API,
instead of just one (although just one also still works)
2016-03-02 15:10:17 -05:00
William Lachance d0ac6d4fb9 Bug 1222540 - Remove cleanup at beginning of perfherder tests
Now that bug 1193836 is fixed, this is no longer necessary.
2015-11-06 14:58:00 -05:00
William Lachance 06fbcd9b09 Bug 1162522 - Don't summarize talos tests with only one subtest 2015-11-05 16:03:17 -05:00
William Lachance ce4b22341d Bug 1149164 - Support ingestion of arbitrary perf data from logs
You can now specify performance data to be ingested from any job just
by adding a line containing PERFHERDER_DATA in it.
2015-10-28 14:34:01 -04:00
William Lachance d3bd244b65 Bug 1175295 - Add support for submitting generic performance artifacts 2015-10-08 16:23:20 -04:00