Commit graph

2563 commits

Author SHA1 Message Date
Felix Schurk
82e0d53cdf
add ctest as test driver (#3446) 2024-05-10 01:20:54 +00:00
Felix Schurk
2361521449
remove stress_test file (#3447)
Close #3422
2024-05-08 21:33:17 -04:00
Dustin J. Mitchell
8aa4758993
add targets for individual tests (#3431) 2024-05-03 10:06:29 -04:00
Dustin J. Mitchell
28a46880a2
Treat a nonzero exit status as a failure (#3430)
And fix the test cases that have been failing ,undetected
2024-05-03 13:58:09 +00:00
Christian Clauss
50cfbe8b63
Fix Python SyntaxError in tests/version.test.py (#3424)
% `ruff check`
```
error: Failed to parse test/version.test.py:92:54: Expected a statement
Error: test/version.test.py:92:54: E999 SyntaxError: Expected a statement
```
2024-05-03 00:30:02 +00:00
Christian Clauss
b7551cbba6
Fix SyntaxWarning invalid escape sequence in Python code (#3433) 2024-05-03 00:22:33 +00:00
Dustin J. Mitchell
94b3e301d1
Remove taskchampion source from this repo (#3427)
* move taskchampion-lib to src/tc/lib, remove the rest
* update references to taskchampion
* Use a top-level Cargo.toml so everything is consistent
* apply comments from ryneeverett
2024-05-02 02:45:11 +00:00
mattsmida
ef9613e2d6
Renaming test files according to their language (#3407) 2024-05-01 14:28:07 -04:00
Felix Schurk
d093ce3d84
Fix test script paths (#3387)
* fix path to task executable in pyton tests

The current approach would copy the current files into the `build/test`
directory. Updating the paths according to the custom user setup.

By the copy I appended `.py` to have a clear visible distingtion which
ones are the python tests.

As soon as a source file in the normal directory is changed, it is
copied over and the corresponding file is updated.

From now on the python tests would need to get run in the according
build directory.

* reflect the current build instruction in PR template

* update paths and globing in run_all

* add line break for every cpp test

* remove .gitignore in test folder

As now all the auxillary files such as `all.log` as well as the
executables are present in the `build` directory there is no longer a
need to ignore them.

* update paths in python test scripts and enable deactivated

* remove .py extension when copy to build

Further remove glob pattern for `*.t.py` tests.

* remove accidentally added template.t from test files
2024-04-28 15:38:14 -04:00
Felix Schurk
eaef05ee95
Update fedora 38 docker container to fedora 40 (#3396) 2024-04-24 08:31:36 -04:00
Dustin J. Mitchell
0a491f36ad
Store all modified tasks for use by on-exit hook (#3352)
The on-exit hook gets all modified tasks as input, but this was omitted
in the previous release. This adds a test for the desired behavior, and
updates TDB2 to correctly store the required information.
2024-04-15 21:14:25 -04:00
Felix Schurk
5a56cff88b
prefix regex strings to be treated as raw strings (#3322)
Source for documentation
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals.
Closes #3316.
2024-03-31 09:08:56 -04:00
Dustin J. Mitchell
aaff97d878
Use opensuse tumbleweed (#3282) 2024-03-04 17:42:27 +00:00
Dustin J. Mitchell
18a8bd2997
Use corrosion instead of CMakeRust (#3273)
* Use corrosion instead of CMakeRust
* use OpenSUSE tumbleweed (latest) to get newer CMake
2024-03-02 16:21:34 -05:00
Felix Schurk
8dd29e0a8a
Change to out-of source build, Update build instructions (#3271)
* update build instructions

Usage of "modern" CMake syntax and using specific out of source build.
Further add example on how to build in parallel, build a specific target
and how to change the compiler.

This closes #3236.
2024-02-25 12:27:52 -05:00
ryneeverett
34c0e67469
show undo diff (#3213)
Exposes undo operations via the C API, and uses those to show a (new, differently formatted) diff before committing the undo.
2024-02-09 22:11:14 -05:00
Dustin J. Mitchell
83bbe4ec37
Fix invalid imports in [{..}] form (#3241)
* Fix invalid imports in `[{..}]` form

Before this change, if an import of data that takes the form of a JSON
array of JSON objects results in an error, the import would be re-tried
assuming that each line of the file is a JSON object (the old format).
However, no check was made that the value actually was an object before
casting it to `json::object`, resulting in a segfault.

This adds the check, and handles the failure with a useful error message
(from the first attempt to parse the file).
2024-01-25 08:01:20 -05:00
Dustin J. Mitchell
5806413d64
Update to supported linux distros (#3248) 2024-01-21 13:13:41 -05:00
Dustin J. Mitchell
9566c929e2
Add support for cloud sync, specifically GCP (#3223)
* Add support for cloud sync, specifically GCP

This adds generic support for sync to cloud services, with specific
spuport for GCP. Adding others -- so long as they support a
compare-and-set operation -- should be comparatively straightforward.

The cloud support includes cleanup of unnecessary data, and should keep
total space usage roughly proportional to the number of tasks.

Co-authored-by: ryneeverett <ryneeverett@gmail.com>
2024-01-21 12:36:37 -05:00
Dathan Bennett
a7bb0c9ba0
Link executables using system frameworks on Darwin (#3075)
* Link test executables using system frameworks on Darwin

On an M1 MBP, running `cmake . && make test` yields the error

```
[ 69%] Linking CXX executable tc.t
Undefined symbols for architecture arm64:
  "_CFRelease", referenced from:
      _$LT$iana_time_zone..platform..system_time_zone..SystemTimeZone$u20$as$u20$core..ops..drop..Drop$GT$::drop::hcd3964de9573de30 in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.15.rcgu.o)
  "_CFStringGetBytes", referenced from:
      iana_time_zone::platform::string_ref::StringRef$LT$T$GT$::to_utf8::h39971b546d587152 in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.13.rcgu.o)
  "_CFStringGetCStringPtr", referenced from:
      iana_time_zone::platform::string_ref::StringRef$LT$T$GT$::as_utf8::h8bb5c2c0d091ded1 in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.13.rcgu.o)
  "_CFStringGetLength", referenced from:
      iana_time_zone::platform::string_ref::StringRef$LT$T$GT$::to_utf8::h39971b546d587152 in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.13.rcgu.o)
  "_CFTimeZoneCopySystem", referenced from:
      iana_time_zone::platform::system_time_zone::SystemTimeZone:🆕:hc42d30609914d79d in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.15.rcgu.o)
  "_CFTimeZoneGetName", referenced from:
      iana_time_zone::platform::system_time_zone::SystemTimeZone::name::h44947ee6deb3339a in libtc_rust.a(iana_time_zone-0e2714c6ff24f5bb.iana_time_zone.4cacef0c-cgu.15.rcgu.o)
  "_SecRandomCopyBytes", referenced from:
      ring::rand::darwin::fill::h0ad94d66d4e1a222 in libtc_rust.a(ring-e5f87a2e334d4c6a.ring.a21bac31-cgu.4.rcgu.o)
  "_kSecRandomDefault", referenced from:
      ring::rand::darwin::fill::h0ad94d66d4e1a222 in libtc_rust.a(ring-e5f87a2e334d4c6a.ring.a21bac31-cgu.4.rcgu.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [test/tc.t] Error 1
make[2]: *** [test/CMakeFiles/tc.t.dir/all] Error 2
make[1]: *** [test/CMakeFiles/test.dir/rule] Error 2
```

This change resolves the error by updating the targets in
test/CMakeLists.txt to link against the CoreFoundation and Security
frameworks when building under Mac OS.

* Link executables against CoreFoundation and Security frameworks on Mac OS

* Rename test_osx.sh to test_macos.sh

---------

Co-authored-by: Dathan Bennett <dathanb@netflix.com>
2023-07-20 17:23:12 -04:00
Dustin J. Mitchell
31105c2ba3
Sync against taskchampion-sync-server (#3118)
This removes use of gnutls and the TLS implementation, which is no
longer needed (task synchronization is handled via Taskchampion, which
uses `reqwest`, which handles TLS via other Rust dependencies). This
incidentally removes the following config options:
 * `debug.tls`
 * `taskd.ca`
 * `taskd.certificate`
 * `taskd.ciphers`
 * `taskd.credentials`
 * `taskd.key`
 * `taskd.server`
 * `taskd.trust`
2023-07-08 10:27:33 -04:00
Dustin J. Mitchell
a69b0c8032 Remove properties when set to an empty string
Fixes #3109.
2023-06-11 17:37:03 -04:00
Dustin J. Mitchell
6cd5bf1237 Update "modified" on modification 2023-06-11 17:37:03 -04:00
Dustin J. Mitchell
02de8dfe67 remove TDB2::commit call from tests 2023-06-11 17:37:03 -04:00
Dustin J. Mitchell
5bb9857984 Use Taskchampion to store Taskwarrior data
This replaces the TF2 task files with a TaskChampion replica.
2023-06-11 17:37:03 -04:00
Dustin J. Mitchell
4b814bc602 [BREAKING] remove diff display from 'task undo'
TaskChampion does not make the necessary information available to
accomplish this, but see #2928.
2023-06-11 17:37:03 -04:00
Dustin J. Mitchell
87467f72c7 [BREAKING] remove 'task purge' support
TaskChampion removes deleted tasks automatically when they expire, so
this subcommand is no longer required.
2023-06-11 17:37:03 -04:00
Dustin J. Mitchell
ddd367232e [BREAKING] Remove journal.info support
This support will require access to all of the operations ever performed
on a task, which is not currently exposed by TaskChampion (but see #2928)
2023-04-16 19:21:14 -04:00
ryneeverett
3fdc6d3662 simpletap: simplify to use parent run method
Per the TODO, use `__init__` to override the stream. There don't seem to
be any other substantial changes to the `run` method needed for TAP and
I'm assuming the additional code in the upstream `run` has been added
since this class was written.

My primary motivation was to set `result.buffer = self.buffer` in the
`run` method, which fixes the runner enough to be able to use
`breakpoint()`.

In addition, I updated the shebang in `tw-2189.t` for portability.
2023-01-30 18:33:42 -05:00
Dustin J. Mitchell
88333ac785 Expose is_* methods on tasks. 2022-12-21 16:36:23 -05:00
Tomas Babej
64aa1b1c7e osx: Set LDFLAGS to search Foundation and Security 2022-12-18 21:01:36 -05:00
Tomas Babej
3289f93073 tests: Adjust comment
The recurrence period is 1m=P30D.
2022-12-18 15:23:55 -05:00
Dustin J. Mitchell
6e5d8b1dde fix recurrence test to avoid wasting a lot of time 2022-12-18 14:21:10 -05:00
Tomas Babej
19f183159e tests: Fail OS-X test workflow on error in the build process
This sets `set -e` to ensure any errors in the test script are
propagated upwards and noticed by the Github workflow.

Prior to these changes failures in the build process of the tests would
be ignored, and the success / failure would be determined purely by the
return code of the `./problems` script.
2022-12-18 14:19:56 -05:00
Dustin J. Mitchell
9e5c0001c4 Skip incorrectly-passing tests (see #2996) 2022-12-18 12:59:28 -05:00
Dustin J. Mitchell
dbeee0640a Add a hint to 'make test' see test problems 2022-12-18 12:01:12 -05:00
Dustin J. Mitchell
f5f37009cb Ignore patch updates for some noisy deps 2022-10-26 17:22:12 -04:00
Dustin J. Mitchell
69850e5f6a [tests] Make sure waiting task is still waiting
10s is gone in an instant in a busy CI box, which is probably why this
test is failing on Macs.
2022-08-10 23:38:04 -04:00
Dustin J. Mitchell
12ecfa2b1e rename rust/ to taskchampion/ 2022-07-29 21:41:41 -04:00
Dustin J. Mitchell
6f7c5c31a9 install Rust on each push in docker images 2022-07-29 21:41:41 -04:00
Dustin J. Mitchell
8c30400af3 Add a C++ wrapper around TC FFI
This uses CMake to build a simple Rust library (in `src/tc/rust`) that
just re-exports everything from the `taskchampion-lib` crate.

The C++ wrappers then wrap this into C++ objects with proper lifecycle
maintenance, in the `tc` namespace.

The C++ wrappers are incomplete, and missing methods are tagged with
"TODO".  These will be added as needed.
2022-07-29 21:41:41 -04:00
Dustin J. Mitchell
e3ef6c504a remove TBD2::clear, only used in tests 2022-07-24 14:18:21 -04:00
Dustin J. Mitchell
271d06cd9c make TDB2.pending/completed non-public
References to methods on these fields are replaced with methods on TDB2,
several of which already existed.
2022-07-24 14:18:21 -04:00
Dustin J. Mitchell
4ebd0ffb39 make TDB2.undo non-public
The stats command calls an API to provide this information in a way that
will still be relevant for TaskChampion, while CmdInfo's access to the
data remains.  The TaskChampion interface for per-task hitsory is still
not ready.
2022-07-24 14:18:21 -04:00
Tomas Babej
2f30bc8cbf tests: Add dockerfile for Ubuntu 22.04 2022-07-24 13:58:10 -04:00
Tomas Babej
08d647102f tests: Remove Ubuntu 21.04 and 21.10 from the test matrix
Both releases are beyond their respective EoL [1].

[1]: https://wiki.ubuntu.com/Releases
2022-07-24 13:58:10 -04:00
Dustin J. Mitchell
c8cfcec48b Make TDB2.backlog non-public
The stats command gets this information from an API that will also work
for TaskChampion.  The sync command still accesses the field directly,
as the command must be completely rewritten for TaskChampion.
2022-06-21 12:05:50 -04:00
Tomas Babej
e60fdafdaa centos8: Fix missing repo metadata 2022-02-11 00:40:31 -05:00
Tomas Babej
0cc2de6179 tests: Add a test for handling short UUIDs in the depends column 2022-01-19 20:11:41 -05:00
Dustin J. Mitchell
28e268bd26 fix parsing invalid depends from server
The data from the server is read via Task::parseJSON, not Task::parse.

This also reverts the tests for Task::parse, and adds new tests for this
specific issue.
2022-01-19 19:34:45 -05:00