Commit Graph

112 Commits

Author SHA1 Message Date
Robert Alonso
46cc6ac8e9 fix: remove subdirectory paths from test_new.diff
When test_proces_diff processes this file, it
fails to create the subdirectories, leading to
test failure. Since the subdirectories aren't
really needed, removing them allows the test
to complete successfully.

Updated number of expected passing tests to
account for the additional tests which can run
to completion now.
2025-04-10 15:28:02 +00:00
alstr
d7086a5471 Update CI workflow 2025-04-10 15:52:28 +01:00
alstr
eded387171 Amend file path to fix test 2025-04-10 15:01:48 +01:00
alstr
1a726726ab Add Dockerfile support
Original PR by @phyzical
See #266
2025-04-10 14:53:23 +01:00
alstr
3c434ec5a9 Fix environment variable name 2025-04-10 14:35:31 +01:00
Alastair Mooney
4417cd5ad9
Update test_new.diff 2025-01-02 15:23:03 +00:00
Alastair Mooney
3ba6066771
Update test_closed.diff 2025-01-02 15:22:40 +00:00
netpoe
c13ebee3c5 fix(test_todo_parser): tests for 'text', removes 'move' 2024-12-28 00:05:25 -06:00
netpoe
ef064d7382 test: test_closed.diff test_new.diff 2024-12-21 22:00:42 -06:00
Robert Alonso
2d98b5c359 fix: handle identifier with regex characters
Provides a test for and the solution to GitHub
issue #242. Namely, an identifier which contains
regex characters (e.g. "[TODO]") is properly
handled by having the parser look for literal
"[" and "]" characters rather than treating those
characters as part of a regex pattern. The word
boundary regex pattern '\b' does NOT properly
handle this, so a slightly different pattern is
used to identify the boundary.
2024-11-12 16:34:09 +00:00
Robert Alonso
948c3e0507 fix: don't include source with issue URL comment
If TODO comment is a suffix to a line of
(executable) source, don't repeat the source
content when inserting the issue URL. But be sure
to still keep the same alignment.

Closes #229
2024-11-12 14:28:40 +00:00
Robert Alonso
46218738c9 fix: get correct line numbering of old and new lines
track context of old and new lines separately to
get proper line numbers relative to old and
new version of a file

Closes GitHub #236
2024-11-12 12:18:43 +00:00
Robert Alonso
8c28d096ee test: allow test to be an expected success now that bug is fixed
Earlier commit resolved issue #234
2024-11-12 00:18:47 +00:00
Robert Alonso
7ce78256b6 test: allow test to be an expected success now that bug is fixed
Earlier commit resolved issues #216, #224, #225
2024-11-12 00:18:47 +00:00
Robert Alonso
f0ed571547 test: add test to track additional bugs
Several related bugs that stem from a diff that
contains both deletions and additions. Specifically,
the line numbers aren't counted correctly, leading
to
- issue URL can't be inserted because it can't find
  the right line in the latest file
- generated issue references the wrong line number
- closed issue references the wrong line number

See GitHub issue #236

The last item might not have any actual impact as
(I think) it's just informational. But it'd still
be better if it reported the correct line number
of the deletion, which necessarily has to be
relative to the _old_ file's line number, not the
updated file's.

As there is no solution in place yet for these
bugs, the unittest is marked as an expected failure
2024-11-12 00:18:38 +00:00
Robert Alonso
c643aecf02 refactor: optionally output log if _standardTest fails
Defaults True for backwards compatibility
2024-11-11 23:52:41 +00:00
Robert Alonso
69e2360329 test: allow multiple diff files to be consumed
This sets up the ability to have one diff file
create a simulated filesystem and a second to
simulate an edit of an existing file
2024-11-11 23:52:41 +00:00
Robert Alonso
872a997803 test: add tests to capture additional known issues
These tests capture the existing issues #234 and
issue #235. As no solution is in place yet, they're
marked as expected failures.
2024-11-11 23:52:36 +00:00
Robert Alonso
2997380286 test: added tests for known bugs
Added tests for issues #224/#225 and #229. Since
these are known bugs, the tests are currently
marked as expected failures. Once the solution
is implemented, that designation can be removed
and we'll still keep the test to make sure there
aren't any regressions.
2024-11-10 04:28:37 +00:00
Robert Alonso
30b3d43dec refactor: consolidate test classes
I initially thought it a good idea to split these
up, but it led to a lot of unnnecessary code
redundancy. This is a better approach.
2024-11-09 19:56:03 +00:00
Robert Alonso
325fbaf03b test: add additional test demonstrating current bug
Added a test which demonstrates a current bug where
if multiple TODOs with the same title appear in
the diff of the same file, only one of those issues
will have its URL succesfully inserted.
(Specifically, the first from the top.) As such,
the test is configured as an expected failure until
such time as the bug can be fixed.
2024-11-09 19:28:09 +00:00
Robert Alonso
61cb584226 refactor: split unit test class to have a common base class 2024-11-09 19:28:09 +00:00
Robert Alonso
d57788aa0b fix: split diff file to allow process_diff unit test to pass
The diff file has a couple of hunks which for
some unknown reason have parsing issues which
result in the wrong line being detected for where
the TODO is. This causes the issue URL insertion
to fail. That's its own issue that should be
investigated, but in order to allow the process_diff
unit test to pass, the diff file is being split
into two to isolate the trouble-causing hunks.
2024-11-09 19:28:09 +00:00
Robert Alonso
246bf5d5bf fix: fix additional formatting issues with diff file
Wrong line numbering is causing issue URLs to not
be inserted when processing this diff file
2024-11-09 19:28:09 +00:00
Robert Alonso
cd754de86c test: print message when issue URL has actually been inserted
Insertion of the URL is different from simply
creating/updating the issue, so we want to have
this level of output to ensure that as many
file updates as expected are actually occurring.

Note: The unit test is currently failing!
2024-11-09 19:28:08 +00:00
Robert Alonso
590a050199 test: add test to exercise main's process_diff()
Reads the diff file to generate a simulated
filesystem, inserts the URL comments into these
new files, and then parses the output to confirms
that all of the issues that were expected to be
created were created.
2024-11-09 19:28:08 +00:00
Robert Alonso
da6872a340 refactor: clean up and split off diff file
test_new.diff had some issues which would cause
errors if trying to actually use the diff file
with 'patch' to create the files it references.

1) had some line numbers which were invalid
2) had path specifications and, unfortunately,
   'patch' does not support creating absent directories

The file has been cleaned up to have the create
line numbers and to assume that all files are at
the root.

Additionally, for the few cases where the diff
file referred to an edit rather than creation of a
whole new file, those diff hunks were moved into a
new, separate, file.

There is no functional change with this commit,
but it sets up future test features.
2024-11-09 19:28:08 +00:00
Alastair Mooney
4b44510149
Update test_todo_parser.py
Fix import error
2024-11-05 09:51:15 +00:00
Robert Alonso
649e50253b test: add unittest to run mypy
New unittest file consists of two tests. Both
run mypy, but one does so with arguments that are
expected to allow the test to pass. The other does
not provide those arguments and is expected to fail.
The expected failure is intentional, to serve as
an ongoing reminder to try to 1) move towards having
strict typing in the codebase and to 2) not
add any additional errors/warnings in the meantime.

Separated requirements into runtime (requirements.txt)
and additional development (requirements-dev.txt).
Modified devcontainer and workflow to reflect the
change.
2024-10-28 18:38:59 +00:00
Robert Alonso
67fd1f496c fix: reset modified environment variables after test
CustomLanguageTest was modifying a few environment
variables and not restoring them when complete. This
led to problems for later tests that expected those
variables to be at their default values.
2024-10-25 18:54:29 +00:00
Alex Harris
220a09bb7c test: Added tests for TOML support 2024-10-11 18:15:04 +01:00
Alastair Mooney
92f6bda7f0
Update test_todo_parser.py 2024-10-11 10:24:24 +01:00
Miguel Palhas
64aac3bc8a code review 2024-10-09 18:21:46 +01:00
Miguel Palhas
d6f93f3748 code review 2024-10-08 15:57:45 +01:00
Miguel Palhas
4f3709febb code review 2024-10-08 12:32:18 +01:00
Miguel Palhas
94022cee51 code review 2024-10-08 12:16:19 +01:00
Miguel Palhas
7b5d19e941 code review 2024-10-08 12:02:02 +01:00
Miguel Palhas
e88cba0c82 code review 2024-10-08 11:57:17 +01:00
Miguel Palhas
26ed78e3f4 code review 2024-10-08 11:55:07 +01:00
alstr
f8090bda34 Update tests 2024-09-25 13:12:26 +01:00
Alastair Mooney
c49e159070
Update test_todo_parser.py 2024-09-25 13:01:51 +01:00
Alastair Mooney
f7cea8d10c
Merge branch 'master' into master 2024-09-25 12:54:20 +01:00
alstr
2f462edd70 Merge master into v5 2024-09-24 14:31:16 +01:00
alstr
935bd1b4d0 Update tests 2024-09-24 14:14:28 +01:00
Kevin Ge
6ee994070c fix: number of Starlark tests in comment 2024-08-05 22:41:00 -07:00
Kevin Ge
1ff063b19e fix: check filename if no extensions match 2024-08-05 22:38:54 -07:00
klarkc
7d8b984900
Add Agda doc and tests 2024-07-11 16:29:45 -03:00
klarkc
fe5e34d9ad
Add support for PureScript 2024-07-11 16:16:15 -03:00
unclebabykern
8ba861435d test: add TSX closed issue tests and merge JSON 2024-07-03 18:00:20 -06:00
unclebabykern
2398638d34 cleanup redundant JS test func and add tsx 2024-07-01 17:48:55 -06:00