Commit Graph

10492 Commits

Author SHA1 Message Date
Ross Patterson
b8268500ef build(test): Fix redundant target recipe runs
The VCS hook installation was running when no changes had been made to
`./.pre-commit-config.yaml` because something else had changed the contents of `./.tox/`
resulting in it having a newer modification time stamp.  Fix this by using an explicit
log file as the target instead of the directory.
2020-09-27 09:44:40 -07:00
Ross Patterson
5da9b8c398 test(vcs): Add a VCS commit hook to run linters 2020-09-27 09:44:13 -07:00
Ross Patterson
b306475370 test(runner): Save iteration time, fail early
The `codechecks` commands run fastest and show the most obvious errors so no need to
wait for the longer-running other tests first.
2020-09-25 10:22:04 -07:00
Ross Patterson
2ef422e064 test(vcs): Add a VCS push hook to run tests
Personally, I can't stand working without a VCS hook anymore.  It saves me so much time
in context switches from revisiting and revising PRs when I see that the CI run is red.
Much better to fail before I push so I can revise while the relevant changes are fresh
in my head.

In order to start using this, one has to run `$ make build` first.  Should I add that
and make other documentation changes in the wiki related to my changes in this PR?
2020-09-25 10:18:11 -07:00
Ross Patterson
ce20ac6a74 test(coverage): Avoid redundant test runs
There's no need in almost all cases to run the tests both under the coverage collector
and without it.  This fixes the default set of tests to avoid that.  Specifically, don't
run tests under the coverage collector by default for all environments since we don't
capture any error or failure conditions on reporting coverage anyways.
2020-09-24 12:38:42 -07:00
Ross Patterson
a8ef046b50 build(news): Fix missing ChangeLog entry 2020-09-24 11:44:38 -07:00
Ross Patterson
430881be15 test(py3): Capture how to run all tests under py3
Useful to review common errors under Python 3 as opposed to module-by-module.
2020-09-24 11:37:58 -07:00
Ross Patterson
92de966c91 test(runner): Use checked out source for local tests
TL;DR: Capture how to use real source file paths for local development.

It can be useful to run the tests against the currently checked out Python source files.
Changes are reflected immediately.  Source file paths in Tracebacks (and other things
that print the file path for Python modules) are to the actual checked out source and
can be copied and pasted or used by tools that expect real paths.

OTOH, testing against a real Python package install into a virtualenv done from a real
source distribution can expose rare but very confusing issues.

So doing both is valuable.  Most typically, the former is useful for local development
and the latter is most appropriate in CI.
2020-09-24 11:37:49 -07:00
Ross Patterson
1593ff5c52 test(coverage): Include human-readable coverage report
While the XML coverage report is useful for consumption by other tools, such as
currently by codecov.io in CI, it's not very useful for humans reviewing the immediate
impact of changes on coverage during local development or while monitoring CI output.  I
don't think running the text report takes much more time so I don't see a downside
here.
2020-09-24 11:37:37 -07:00
Ross Patterson
0c533733f0 test(runner): Match contributor guidelines from wiki
The [Patches Trac Wiki page](https://tahoe-lafs.org/trac/tahoe-lafs/wiki/Patches) says
that users should run the `codechecks` tox environment, so this change runs it be
default as the full tox test suite eliminating the extra step.
2020-09-24 11:36:58 -07:00
Ross Patterson
827cba21a3 Merge branch '3421.makefile-housekeeping' 2020-09-23 11:24:51 -07:00
Ross Patterson
2645675649 build(make): Exclude changelog entry from NEWS
This includes only developer-oriented changes.
2020-09-23 10:31:42 -07:00
Sajith Sasidharan
c2e9d6057f
Merge pull request #819 from sajith/3425.return-errorpage-from-root
Return ErrorPage from web.root

Fixes ticket:3425
2020-09-23 10:18:44 -04:00
Sajith Sasidharan
a413eb8626 Use BeautifulSoup in RenderSlashUri tests 2020-09-23 08:32:19 -04:00
Sajith Sasidharan
9aee312d8c
Merge pull request #822 from sajith/3429.return-errorpage-from-check-results
Return ErrorPage from web.check_results

Fixes ticket:3429
2020-09-22 20:40:00 -04:00
Sajith Sasidharan
4e4c5f9b7f
Merge pull request #820 from sajith/3424.return-errorpage-from-operations
Return ErrorPage from web.operations

Fixes ticket:3424
2020-09-22 20:38:34 -04:00
Sajith Sasidharan
da78bc05d0
Merge pull request #818 from sajith/3423.return-errorpage-from-filenode
Return ErrorPage from filenode

Fixes ticket:3423
2020-09-22 20:37:55 -04:00
Sajith Sasidharan
6d9e1a7a47
Merge pull request #821 from sajith/3426.return-errorpage-from-status
3426 Return ErrorPage from web.status

Fixes ticket:3426
2020-09-22 08:32:16 -04:00
Sajith Sasidharan
136a70217c Remove unused import 2020-09-21 20:44:49 -04:00
Sajith Sasidharan
fd5436b867 Expect ErrorPage in RenderSlashUri tests 2020-09-21 18:34:53 -04:00
Sajith Sasidharan
18e56e41fc Return error page when an exception is raised from web.check_results 2020-09-21 18:18:29 -04:00
Sajith Sasidharan
20101f8146 Return ErrorPage when an exception is raised in web.status 2020-09-21 16:51:27 -04:00
Sajith Sasidharan
c16cf00c6b Return an error page when an exception is raised from web.root 2020-09-21 16:37:36 -04:00
Sajith Sasidharan
e8f7643a8f Return ErrorPage when web.operations raises an exception 2020-09-21 16:26:51 -04:00
Sajith Sasidharan
c34dc78875 Merge 'origin/master' into 3423.return-errorpage-from-filenode 2020-09-21 16:22:57 -04:00
Jean-Paul Calderone
58c99d0c0c
Merge pull request #815 from tahoe-lafs/3422.directory-weberror
Handle exceptions raised by getChild and render_* in directory.py

Fixes: ticket:3422
2020-09-21 16:04:39 -04:00
Jean-Paul Calderone
0e139114f7 add a limited amount of missing test coverage for humanize_exception 2020-09-21 14:07:11 -04:00
Sajith Sasidharan
199fbfcc1c Return error pages when an exception is raised in filenode 2020-09-21 13:24:01 -04:00
Sajith Sasidharan
c674198074 Rearrage imports 2020-09-21 13:03:51 -04:00
Itamar Turner-Trauring
139bcb1500
Merge pull request #814 from tahoe-lafs/3419.test-encode-python-3-trying-again
Port test_encode to Python 3

Fixes ticket:3419
2020-09-21 11:52:34 -04:00
Itamar Turner-Trauring
7c6e3104ac
Merge pull request #812 from tahoe-lafs/3416.test-encode-python-3
Port allmydata.test.no_network to Python 3

Fixes ticket:3416
2020-09-21 11:51:34 -04:00
Itamar Turner-Trauring
a4da6c3dbe Clarify comment. 2020-09-21 10:35:56 -04:00
Itamar Turner-Trauring
02b4ec8101 Get rid of stray print(). 2020-09-21 10:33:16 -04:00
Jean-Paul Calderone
b200d20430 minor cleanups/rearranging 2020-09-18 15:01:53 -04:00
Ross Patterson
52015df7e4 build(make): Add changelog entry for PR 2020-09-18 11:59:40 -07:00
Ross Patterson
d0d11a5444 fix(style): Wrong Python version for codechecks
On systems where the default Python is Python 3 (such as on recent Debian/Ubuntu
versions), then `$ tox -e codechecks` has a ton of failures related to Python 3
compatibility.  This explicitly forces it to use Python 2.7 until we have Python 3
compatibility.
2020-09-18 11:59:40 -07:00
Jean-Paul Calderone
97872118a5 derived function below 2020-09-18 14:50:45 -04:00
Jean-Paul Calderone
8f3a32a22c news fragment 2020-09-18 14:49:39 -04:00
Jean-Paul Calderone
e648965fb6 Add helpers to implement the desired exception behavior and use them 2020-09-18 14:49:19 -04:00
Itamar Turner-Trauring
8ef2252bd4 Finish porting to Python 3. 2020-09-18 14:32:19 -04:00
Itamar Turner-Trauring
c3bb367a93 Tests pass on Python 3. 2020-09-18 14:31:23 -04:00
Itamar Turner-Trauring
050388ee12 Work better on Python 3, until Nevow is gone. 2020-09-18 14:31:21 -04:00
Jean-Paul Calderone
059bb2250b Add a BadRequest resource to help with BAD REQUEST 2020-09-18 14:10:09 -04:00
Itamar Turner-Trauring
cb24c3eccf Merge branch '3416.test-encode-python-3' into 3419.test-encode-python-3-trying-again 2020-09-18 13:38:44 -04:00
Itamar Turner-Trauring
a0ff941fff Try to fix Python 3 again. 2020-09-18 13:36:54 -04:00
Itamar Turner-Trauring
e75beb6eae
Merge pull request #811 from tahoe-lafs/3415.storage-server-python-3
Port allmydata.storage.server to Python 3

Fixes ticket:3415
2020-09-18 13:32:36 -04:00
Jean-Paul Calderone
9682e68528
Merge pull request #805 from jaraco/3408.print-functions
Convert print statements to print functions, even when commented

Fixes: ticket:3408
2020-09-18 12:59:44 -04:00
Itamar Turner-Trauring
7b302871e4 Python 2 tests pass again. 2020-09-18 11:41:28 -04:00
Itamar Turner-Trauring
c5ce988c7e Merge branch '3416.test-encode-python-3' into 3419.test-encode-python-3-trying-again 2020-09-18 11:33:15 -04:00
Itamar Turner-Trauring
1a4744d1f7 Merge branch '3415.storage-server-python-3' into 3416.test-encode-python-3 2020-09-18 11:32:45 -04:00