taskwarrior/test
2022-07-29 21:41:41 -04:00
..
basetest tests: Ensure tests are run with news.version set to 2.6.0 2021-10-02 18:06:12 -04:00
docker install Rust on each push in docker images 2022-07-29 21:41:41 -04:00
scripts tests: Install libfaketime in all containers 2019-02-07 08:37:59 -05:00
simpletap meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
test_certs Merge branch '2.6.0' 2021-10-02 22:04:54 -04:00
test_hooks meta: Update various links to https 2021-03-12 07:58:04 -05:00
.gitignore Add a C++ wrapper around TC FFI 2022-07-29 21:41:41 -04:00
abbreviation.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
add.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
alias.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
annotate.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
append.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
args.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
backlog.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
bash_completion.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
bash_tap.sh meta: Update various links to https 2021-03-12 07:58:04 -05:00
bash_tap_tw.sh meta: Update various links to https 2021-03-12 07:58:04 -05:00
blocked.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
bulk.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
burndown.t Changed burndown test so it doesn't block forever 2021-09-11 13:56:03 -04:00
calc.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
calendar.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
caseless.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
CMakeLists.txt rename rust/ to taskchampion/ 2022-07-29 21:41:41 -04:00
col.t.cpp meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
color.cmd.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
color.rules.t tests: Make sure test accessing header output have correct verbosity tokens 2021-09-16 07:15:54 -04:00
columns.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
commands.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
completed.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
configuration.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
confirmation.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
context.t tests: Add test to cover invalid contexts due to tag exclusion 2021-11-06 11:58:47 -04:00
conversion Test: Fixed error in conversion now there are no more bug.*.t scripts 2015-10-23 09:19:45 -04:00
count.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
custom.config.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
custom.recur_ind.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
custom.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
custom.tag_ind.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
date.iso.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
dateformat.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
datesort.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
datetime-negative.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
debug.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
default.t tests: Make sure test accessing header output have correct verbosity tokens 2021-09-16 07:15:54 -04:00
delete.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
denotate.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
dependencies.t tests: Add a test for handling short UUIDs in the depends column 2022-01-19 20:11:41 -05:00
diag.t tests: Skip the diagnostics test on Ubuntu 16.04 2021-10-02 21:32:21 -04:00
diag_color.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
dom.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
dom2.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
due.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
duplicate.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
edit.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
encoding.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
enpassant.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
eval.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
exec.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
export.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
feature.559.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
feature.default.project.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
feature.print.empty.columns.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
feature.recurrence.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
feedback.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
filter.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
fontunderline.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
format.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
gc.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
helpers.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
history.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
hooks.env.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
hooks.on-add.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
hooks.on-exit.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
hooks.on-launch.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
hooks.on-modify.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
hyphenate.t tests: Remove expected failure 2021-09-16 07:33:53 -04:00
ids.t test: Add tests for parsing ID ranges of various sizes 2021-10-18 23:46:45 -04:00
import.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
info.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
lexer.t.cpp use emplace 2021-08-05 02:03:59 -04:00
limit.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
list.all.projects.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
log.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
logo.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
math.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
modify.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
nag.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
obfuscate.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
oldest.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
operators.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
overdue.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
partial.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
prepend.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
pri_sort.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
problems Enforce Python 3 for unittests 2020-12-06 10:00:59 -05:00
project.t test for dashes in proj without incidentally testing DOM references in 'task add' 2021-12-30 15:03:37 -05:00
purge.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
quotes.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
rc.override.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
README Docs: Updated URLs 2018-05-14 00:51:53 -04:00
recurrence.t fix test to pass at the end of the year 2021-12-30 15:03:37 -05:00
reports.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
run_all Enforce Python 3 for unittests 2020-12-06 10:00:59 -05:00
search.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
sequence.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
shell.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
show.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
sorting.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
special.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
start.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
stats.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
stress_test Enforce Python 3 for unittests 2020-12-06 10:00:59 -05:00
substitute.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
sugar.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
summary.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
t.t.cpp fix parsing invalid depends from server 2022-01-19 19:34:45 -05:00
tag.t tests: Add bulk removal test for tags attribute 2021-11-22 15:51:27 +01:00
taskrc.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
tc.t.cpp Add a C++ wrapper around TC FFI 2022-07-29 21:41:41 -04:00
tdb2.t.cpp remove TBD2::clear, only used in tests 2022-07-24 14:18:21 -04:00
template.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
test.cpp meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
test.h meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
timesheet.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
tw-20.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
tw-46.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
tw-262.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
tw-295.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
tw-1379.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
tw-1637.t Test: Added explanation 2015-07-25 14:06:32 -04:00
tw-1643.t TW-1643: Add failing test 2015-07-30 13:13:38 +02:00
tw-1688.t Test: Simplify tw-1688.t 2015-09-11 17:22:00 +02:00
tw-1715.t TW-1715: No UDA needed, same problem with core attributes 2015-10-16 10:08:13 +02:00
tw-1718.t TW-1718: Test for "String UDA not passed through unchanged" 2015-10-26 09:50:54 +01:00
tw-1804.t tests: Add test for TW #1804 2021-06-23 00:13:03 -04:00
tw-1837.t Merge branch '2.6.0' 2021-10-02 22:04:54 -04:00
tw-1883.t Prefer /usr/bin/env and searching from PATH 2021-06-02 19:35:18 -04:00
tw-1895.t test: Make all tests executable 2021-06-19 12:29:41 -04:00
tw-1938.t tests: Add test for TW #1938 2021-06-19 12:29:41 -04:00
tw-1999.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
tw-2124.t Prefer /usr/bin/env and searching from PATH 2021-06-02 19:35:18 -04:00
tw-2189.t tests: Add test for TW-2189 2021-08-28 21:01:29 -04:00
tw-2257.t Prefer /usr/bin/env and searching from PATH 2021-06-02 19:35:18 -04:00
tw-2386.t Prefer /usr/bin/env and searching from PATH 2021-06-02 19:35:18 -04:00
tw-2392.t tests: Expand tests for #2392 2021-01-30 21:53:37 -05:00
tw-2429.t test: Make all tests executable 2021-06-19 12:29:41 -04:00
tw-2451.t test: Make all tests executable 2021-06-19 12:29:41 -04:00
tw-2514.t tests: Add test for TW #2514 2021-06-26 14:38:18 -04:00
tw-2530.t tests: Add a regression test for #2530 2021-07-10 07:24:57 -04:00
tw-2550.t test: Add tests for TW #2550 2021-08-15 22:50:55 -04:00
tw-2563.t tests: Make sed/wc calls in tw-2563 compatible with OS-X' 2021-08-08 14:27:25 -04:00
tw-2575.t task <filter> export [<report>] 2021-08-29 12:48:18 -04:00
tw-2581.t tests: Add test for TW #2581 2021-08-21 01:06:55 -04:00
tw-2689.t.cpp fix parsing invalid depends from server 2022-01-19 19:34:45 -05:00
uda.t tests: Adjust test description 2021-10-16 11:02:38 -04:00
uda_orphan.t tests: Add test for UDA Orphan identification 2021-10-16 10:22:34 -04:00
uda_report.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
uda_sort.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
undo.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
unicode.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
unique.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
upgrade.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
urgency.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
urgency_inherit.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
util.t.cpp Replace direct Task.data access with a temp getter (syntactic refactor) 2021-12-16 23:03:44 -05:00
uuid.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
variant_add.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_and.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_cast.t.cpp tests: Adjust tests for recent variant changes 2021-01-18 02:59:11 -05:00
variant_divide.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_equal.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_exp.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_gt.t.cpp tests: Adjust tests for recent variant changes 2021-01-18 02:59:11 -05:00
variant_gte.t.cpp tests: Adjust tests for recent variant changes 2021-01-18 02:59:11 -05:00
variant_inequal.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_lt.t.cpp tests: Adjust tests for recent variant changes 2021-01-18 02:59:11 -05:00
variant_lte.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_match.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_math.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_modulo.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_multiply.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_nomatch.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_not.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_or.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_partial.t.cpp tests: Add test for partial operator over date/string pairs 2021-06-12 15:49:06 -04:00
variant_subtract.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
variant_xor.t.cpp docs: Update copyright 2021-01-03 22:58:02 -05:00
verbose.t meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
version.t Don't look for a specific sha when testing task version 2021-11-21 23:34:46 +01:00
view.t.cpp meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
wait.t tests: Expand test for waiting report 2021-10-16 11:11:45 -04:00

README
======

This is the task.git/test/README file, and contains notes about the Taskwarrior
test suite.


Running Tests
-------------

Do this to run all tests:

  $ cd test && make && ./run_all && ./problems

All unit tests produce TAP (Test Anything Protocol) output, and are run by the
'run_all' test harness.

The 'run_all' script produces an 'all.log' file which is the accumulated output
of all tests. Before executing 'run_all' you need to compile the C++ unit
tests, by running 'make' in the 'test' directory.

The script 'problems' will list all the tests that fail, with a count of the
failing tests, once you have run all the tests and produced an 'all.log' file.

Any TAP harness may be used.

Note that adding the '--serial' option to ./run_all, all tests are executed
serially.  The default runs Python, C++ and Bash tests in parallel. Using
'--serial' will make for a slower test run.


Architecture
------------

There are three varieties of tests:

  * C++ unit tests that test low-level object interfaces. These are typically
    very fast tests, and are exhaustive in nature.

  * Python unit tests that are at the highest level, exercising the command
    line, hooks and syncing. There is an example, 'template.t', that shows how
    to perform various high level tests.

  * Bash unit tests, one test per file, using the bash_tap_tw.sh script. These
    tests are small, quick tests, not intended to be permanent.

All tests are named with the pattern '*.t', and any other forms are not run by
the test harness. Additionally a test must be set executable (chmod +x) for it
to be run. In the case of Python tests one can still run them manually by
launching them with 'python test.t' or simply './test.t'. It also allows us to
keep tests submitted for bugs that are not scheduled to be fixed in the
upcoming release, and we don't want the failing tests to prevent us from seeing
100% pass rate for the bugs we *have* fixed.


Goals
-----

The test suite is evolving, and becoming a better tool for determining whether
code is ready for release. There are goals that shape these changes, and they
are:

  * Increase test coverage by testing more features, more thoroughly. The test
    coverage level is (as of 2016-07-24) at 86.5%.

  * Write fewer bug regression tests. Over time, bug regression tests are less
    useful than feature tests, and more likely to contain overlapping coverage.

  * Eliminate obsolete tests, which are tests that have overlapping coverage.
    There is simply no point in testing a feature twice, in the same manner.


What Makes a Good Test
----------------------

A good test ensures that a feature is functioning as expected, and contains
both positive and negative aspects, or in other words looks for expected
behavior as well as looking for the absence of unexpected behavior.


Conventions for writing a test
------------------------------

If you wish to contribute tests, please consider the following guidelines:

  * For a new bug, an accompanying test is very helpful.  Suppose you write up
    a bug, named TW-1234, then the test would be a script named tw-1234.t, and
    based on the template.t example.

    Over time, we will migrate the tests in tw-1234.t into a feature-specific
    test script, such as filter.t, export.t, whichever is appropriate.

  * Tests created after bugs or feature requests should (ideally) have an entry
    on https://github.com/GothenburgBitFactory/taskwarrior/issues and should
    include the issue ID in a docstring or comment.

  * Class and method names should be descriptive of what they are testing.
    Example: TestFilterOnReports

  * Docstrings on Python tests are mandatory. The first line is used as title
    of the test. Include the issue ID - there are many examples of this.

  * Extra information and details should go into multi-line docstrings or
    comments.

  * Python tests for bugs or features not yet fixed/implemented should be
    decorated with: @unittest.skip("WaitingFor TW-xxxx"). We would rather have
    a live test that is skipped, than no test.


How to Submit a Test Change/Addition
------------------------------------

Mail it to support@gothenburgbitfactory.org, or attach it to an open bug.


Wisdom
------

Here are some guildelines that may help:

  * If there are any lexer.t tests failing, then ignore all the others and fix
    these first. They are fundamental and affect everything else. One Lexer
    failure can cause 30 symptomatic failures, and addressing any of those is
    wrong.

  * If any of the C++ tests fail, fix them next, for the same reason as above.

  * If you are about to fix a bug, and no tests are failing, add tests that fail
    in a script named tw-XXXX.t. Later, someone will incorporate that test
    script into higher-level feature tests.

  * If the command line parser is not working, start by blaming the Lexer.

  * While the lowest level (C++) tests should be exhaustive, higher level tests
    should not do the same by iterating over the entire problem space. It is a
    waste of time.

  * If you find that you are combining two features into one test, you are
    probably doing it wrong.

  * If you add a feature, then add a test to prove it works, also add a test to
    prove it doesn't simultaneously generate errors. Furthermore test that with
    the feature disabled, or command line arguments missing, appropriate errors
    are reported.


TODO
----

For anyone looking for test-related tasks to take on, here are some suggestions:

  * Find and eliminate duplicate tests.

  * Using <attribute>.startswith:<value> with rc.regex:off still uses regex.

  * Crazy dateformat values are not tested.

  * Invalid UTF8 is not tested.

  * All the attribute modifiers need to be tested, only a few are.

  * Aliases are not well tested, and fragile.

---