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

194 Коммитов

Автор SHA1 Сообщение Дата
dependabot[bot] c355983fe5 Bump isort from 4.3.10 to 4.3.12 in /requirements (#4760)
Bumps [isort](https://github.com/timothycrosley/isort) from 4.3.10 to 4.3.12.
- [Release notes](https://github.com/timothycrosley/isort/releases)
- [Changelog](https://github.com/timothycrosley/isort/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/timothycrosley/isort/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-06 14:54:00 -08: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 52d6017c5b
Bug 1295997 - Skip parsing logs whose compressed size exceeds 5MB (#4700)
Occasionally failing build/test runs can fail in such a way that results
in a significant amount of log spam and therefore log files that are
hundreds of MB in size each. This can cause log parsing backlogs,
particularly when many jobs on the same push fail in such a way.

The log parser now checks the `Content-Length` of log files prior to
streaming them, and skips the download/parse if it exceeds the set
threshold. The frontend has been adjusted to display an appropriate
message explaining why the parsed log is not available.

The threshold has been set to 5MB, since:
* the 99th percentile of download size on New Relic was ~2.8MB:
  https://insights.newrelic.com/accounts/677903/dashboards/339080
* `Content-Length` is the size of the log prior to decompression, and
  the chronic logspam cases have been known to have compression ratios
  of 20-50x, which would translate to an uncompressed size limit of
  up to 250MB (which is already much larger than buildbot's former 50MB
  uncompressed size limit).
2019-02-25 19:04:38 +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
Ed Morley e1ebb72c1d Bug 1526743 - Clean up log parsing test utilities
Previously any exceptions raised whilst loading the expected output JSON
fixtures were suppressed, which made debugging the Python 3 test failures
harder than needs be.

The reason failures were suppressed was to allow the test to continue far
enough that the actual output could be saved to the fixture when creating
new tests. However reordering `do_test()` has the same effect without the
need for the `load_exp()` try-except handling.
2019-02-12 20:00:16 +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 fdb62a6243 Bug 1522101 - Use two-space indent when generating sample data JSON
So that future generated JSON sample data matches the Prettier style.
2019-01-23 20:19:04 +00:00
Kartikaya Gupta (kats) d40959ee53 Bug 1512676 - Match some bash startup errors from run-task as errors lines (#4434) 2019-01-08 19:16:09 +00:00
George Hickman b787f78cce Move tests to internal ES wrapper 2018-04-24 15:45:48 +01:00
Ed Morley c31e1dcc81
Bug 1453297 - Remove datadiff (#3435)
Since `pytest -vv` displays useful diffs on its own now.
2018-04-11 13:26:42 +01:00
Ed Morley dfb91271f0 Bug 1452212 - Add missing raw string annotations
Fixes pylint `anomalous-backslash-in-string`.
2018-04-10 20:10:27 +01:00
Ed Morley 6eaf49ab43 Bug 1452212 - Remove unused variables
As reported by pylint 'unused-variable'.
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 9cdeb4665a Bug 1428045 - Convert print statments to print functions 2018-03-21 11:56:27 +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
Cameron Dawson e181d21989 Bug 1373008 - Store test group for FailureLines as a many-to-many relationship
Test Group is often a manifest, but not necessarily.  It could be just
``default`` when there is no manifest.
2017-06-23 09:04:25 -07:00
James Graham cc18394ac1 Stop creating TextLogSummary objects when crossreferencing lines.
These are legacy from before we has TextLogError in the database and aren't needed now
2017-06-06 19:39:04 +01:00
James Graham 7a6e293a7a Bug 1354694 - Add REFTEST ERROR to the list of error strings
This assumes that any line involving the words REFTEST ERROR is always
a failure. It is possible that we will need restrict this if there are
passing tests that produce that in their output.
2017-04-21 11:48:11 +01:00
jgraham 64c67b258a Bug 1351408 - Skip unmatchable failure_line entries when trying to crossreference lines (#2299) 2017-03-28 21:36:26 +01:00
Ed Morley aff2152a81 Bug 1165356 - Log parser: Remove tests workaround for file:// log URLs
Now that we're using requests, the log URL being used to access the file
is consistent across environments (since it doesn't reference the local
directory structure), so we don't need to exclude it from comparisons.
2017-03-22 00:50:02 +00: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 4fcd020fa0 Bug 1348829 - Remove deadcode found using vulture
The logparser parts are leftover from bug 1302844. The SETA parts appear
to have been unused at the time of the original landing.
2017-03-20 16:44:06 +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
Ed Morley 88b1a91a9f Bug 1328322 - Remove obsolete commands/remove_duplicate_summaries.py 2017-02-21 16:35:34 +00: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
Ed Morley 02428ca8f7 Bug 1292720 - Remove support for UCS-2 mode Python
Since Heroku is now using a UCS-4 mode Python, matching Vagrant/Travis.
2017-01-03 22:01:54 +00: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 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
jgraham 3f9c754c78 Bug 1311840 - Add temporary command to remove duplicate text_log_summary_line entries (#1946) 2016-10-26 10:16:57 +01:00
jgraham f769d2dbbc Bug 1311840 - Bail if we try to run crossreference_error_lines on a job with an existing TextLogSummary (#1942) 2016-10-24 14:49:16 +01:00
James Graham 3a7b5dc651 Bug 1310972 - Use job id as input to log parsing tasks
Now that log information is in the main treeherder database use the id
information there as the input to the log parsing and autoclassification
tasks.

As part of the same change there is a mild refactor of the
autoclassification related tasks to not go through the call_command
infrastructure as this is just unnecessary overhead.
2016-10-19 16:58:51 +01:00
William Lachance b035647fe2 Bug 1281820 - Remove all bug suggestion artifact storage code + tests (#1927) 2016-10-18 11:32:52 -04:00
Jonathan French 23f79e50fb Bug 1306878 - Add job artifact test data generation (#1920) 2016-10-17 12:23:08 +01: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 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 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
Gregory Szorc d65979dc9b Bug 1297184 - Strip TaskCluster log prefix when parsing logs (#1842)
Upcoming changes in bug 1295380 will change log output for many tests
in TaskCluster resulting in lines being prefixed with a timestamp and
the task step name. Unless these line prefixes are handled, it
confuses the error parser.

This commit detects logs as coming from TaskCluster and strips their
line prefix accordingly.
2016-09-12 16:47:59 -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
Ed Morley 7d5bf5144c Revert "Bug 1297184 - Strip TaskCluster log prefix when parsing logs (#1836)"
Since it breaks detection of error lines like `[taskcluster:error]`.

This reverts commit df658a2666.
2016-09-09 10:28:10 +01:00
William Lachance e5a19c182f Bug 1258861 - Preparatory work for storing text log steps / errors in main db (#1822)
* Model updates, new db tables, migration script for text log db
2016-09-08 14:51:44 -04:00
Gregory Szorc df658a2666 Bug 1297184 - Strip TaskCluster log prefix when parsing logs (#1836)
Upcoming changes in bug 1295380 will change log output for many tests
in TaskCluster resulting in lines being prefixed with a timestamp and
the task step name. Unless these line prefixes are handled, it
confuses the error parser.

This commit detects logs as coming from TaskCluster and strips their
line prefix accordingly.
2016-09-07 17:24:49 -04:00
William Lachance e97b8a349d Bug 1295536 - Don't try to store non-compliant perf data via logparser 2016-08-17 13:57:50 -04:00
William Lachance 600ff8bb83 Bug 1268333 - Ignore pygtk import lines properly (#1781)
Handle newlines after blacklisted strings and add unit tests for this case
2016-08-12 11:41:36 -04:00