Commit Graph

63 Commits

Author SHA1 Message Date
Diego d90f33ee98
Trying to fix merge conflicts 2023-09-05 14:29:08 +02:00
jangko eae7f92d5c
reduce compiler warnings 2023-09-05 14:06:10 +02:00
Diego 3f5c8dcfa7
Handle Exception in teardown 2023-09-05 14:06:06 +02:00
Jacek Sieka e1b7a9f418
cleanups (#32)
* emulate no-suite mode in no-collect mode
* add missing flush
* make tests threadvar too
2023-09-02 20:31:35 +02:00
Jacek Sieka 2300fa9924
Revamped output handling, cleanup and removal of thread mode (#31)
This PR introduces a facelift for `unittest2` bringing its UX into the 21st
century!

By default, a compact dot-based format is used to avoid spamming the console
on success - successes are normal and only minimal information is needed in
the vast majority of runs:

```
[  20/25] HTTP client testing suite                               ................s..... (14.2s)
[  21/25] Asynchronous process management test suite              ....................F. (14.5s)
===========================
  /home/arnetheduck/status/nimbus-eth2/vendor/nim-chronos/build/testall 'Asynchronous process management test suite::File descriptors leaks test'
---------------------------
    /home/arnetheduck/status/nimbus-eth2/vendor/nim-chronos/tests/testproc.nim(465, 27): Check failed: getCurrentFD() == markFD
    getCurrentFD() was 3
    markFD was 5

  [FAILED ] (  0.00s) File descriptors leaks test
```

For each line, we see a suite followed by single-character status markers -
mostly successes but also a skipped and a failed test.

Failures are printed verbosely after the suite is done so they don't get
lost in the success spam along with a simple copy-pasteable line showing
how to reproduce the failure.

The verbose mode has also received an upgrade:

```
  [  20/22]           terminateAndWaitForExit() timeout test
  [OK     ] (  2.00s) terminateAndWaitForExit() timeout test
  [  21/22]           File descriptors leaks test
===========================
  /home/arnetheduck/status/nimbus-eth2/vendor/nim-chronos/tests/testall 'Asynchronous process management test suite::File descriptors leaks test'
---------------------------
    /home/arnetheduck/status/nimbus-eth2/vendor/nim-chronos/tests/testproc.nim(465, 27): Check failed: getCurrentFD() == markFD
    getCurrentFD() was 3
    markFD was 5

  [FAILED ] (  0.00s) File descriptors leaks test
  [  22/22]           Leaks test
```

Here, we can see a "test started" marker so that it becomes clear which test
is currently running and so that any output the test itself prints has the
proper name attached to it.

At the end, there's a summary as well that reiterates the tests that failed so
they can be found in the success spam that the verbose mode generates:

```
[Summary ] 22 tests run: 21 OK, 1 FAILED, 0 SKIPPED
  [FAILED ] (  0.00s) File descriptors leaks test
```

As seen above, the new mode knows how many tests will run: this is thanks
to a new two-phase mode of test running: "collect" and "run"!

The "collection" phase is responsible for collecting test metadata which is
later used to run tests in smarter ways, for example in isolated processes.

Unfortunately, it is not fully backwards-compatible because the global setup
might expose order-dependency problems in test suites that previously would
not be visible - for this, we have acompile-time setting for a compatibilty
mode that runs things roughly in the same order as before but disables
some of the fancy functionality.

The changes also come with a bag of mixed stuff:

* the parallel mode is removed entirely - it was broken beyond fixing and
  needs to be rewritten from zero - deadlocks, GC violations and everything
  in between rendered it practically unusable and a source of CI failures
  above all
* an experimental process isolation mode where tests are run in a separate
  process - this is allows many features such as timeouts, output
  verification etc but it also breaks for similar reasons as above:
  "global" code gets executed out of order and repeatedly.
* random UX fixes and cleanups of things like env var reading and command
  line options
2023-09-01 12:23:01 +02:00
Jacek Sieka 299bc9a574
more lent iterators (#30)
* more lent iterators

* bump
2023-08-22 17:26:10 +02:00
Jacek Sieka 0b44f30d9b
avoid potential capture of lent iterator var (#29)
also avoid `quote do` for better line numbers in error messages
2023-08-22 06:50:19 +02:00
jangko 21ed62449d
remove nim 1.2 and 1.4 support 2023-07-28 10:53:13 +07:00
Jacek Sieka b178f47527
v0.0.7 2023-06-06 10:36:56 +02:00
Jacek Sieka 4d5dbb569a
fix stackTrace symbol usage 2023-06-05 23:34:42 +02:00
tersec 5ed05c90fb
use Nim 2.0 in CI (#26) 2023-05-10 10:16:24 +00:00
Tanguy 883c7a50ad
Fix `expect` & nim 1.6 regressions (#24) 2023-02-17 15:23:16 +01:00
jangko 0e18d15d3e
reduce compiler warnings about cannot raise defect 2023-02-14 13:13:26 +07:00
jangko 3f5065b6fd
bump github actions to v3 2023-02-14 12:23:48 +07:00
narimiran 2e7f2040fe switch CI to the supported version of macos
See https://github.com/actions/runner-images/issues/5583
2023-02-14 12:20:56 +07:00
jangko 828310e512
workaround for nim 1.2 backward compatibility: exception in terminal.nim 2023-02-14 11:13:53 +07:00
jangko bed1d50a45
workaround for nim devel in ci 2023-02-14 10:32:06 +07:00
Tanguy fe3650ceea
fix for 1.6 2023-02-10 11:13:45 +01:00
Tanguy 39ed5a784e
Bump version 2023-01-04 15:52:46 +01:00
Tanguy c445f0e489
cleaner 2023-01-04 15:49:22 +01:00
Tanguy fa59d48f2c
Fix warnings 2023-01-04 15:48:30 +01:00
diegomrsantos da8398c45c
Bump the version (#20) 2022-11-07 18:05:13 +01:00
diegomrsantos 297711ddaa
Fix compilation on devel (#19) 2022-11-07 14:27:25 +01:00
Miran bdb5eca353
move -d:nimRawSetjmp to nim.cfg (#14)
Refs https://github.com/status-im/nimbus-build-system/issues/44
2022-07-25 22:06:27 +03:00
Ivan Yonchovski a78e6eb8bc
Update gitignore (#15) 2022-07-12 23:31:12 +03:00
Tanguy f180f596c8
Fix for strict exceptions 2022-06-16 13:28:28 +02:00
Tanguy 26f31488a8
Add -d:unittestPrintTime to show test duration in console (#12)
* Add -d:unittestPrintTime to show test duration in console
* Add environment variable option NIMTEST_TIMING
* Bump version to 0.0.4
2022-05-31 17:12:44 +02:00
Tanguy 9d23c0bebe
Generate documentation in CI (#13)
* Also removes docs from master
2022-05-12 18:23:28 +03:00
Ștefan Talpalaru 24eb5e829e
CI: test with Nim-1.6 and C++ (#11) 2022-01-14 04:15:45 +01:00
Tanguy 4e2893eacb
bump nimble version 2021-12-17 09:09:12 +01:00
Ștefan Talpalaru 02c49b8a99
fix URL 2021-11-22 01:20:30 +01:00
Ștefan Talpalaru 7a32cb7717
try to trigger GitHub Pages 2021-11-22 01:18:09 +01:00
Ștefan Talpalaru 66420a7d93
regenerate HTML docs 2021-11-22 01:08:32 +01:00
Jacek Sieka f1d70dbb8c
better error message on unexpected exception (#10) 2021-08-17 15:45:12 +02:00
Jacek Sieka 4c2ce01e34
reorder code (#9)
declare checkpoint/fail before use to avoid random compile errors
2021-08-16 15:10:04 +02:00
Ștefan Talpalaru 91d4eaa4cc
Nim-1.4 fix (#8)
* Nim-1.4 fix

* CI: use MSYS2
2021-05-22 18:00:55 +02:00
Ștefan Talpalaru b9b61cfe4a
change define prefix and update docs (#7) 2021-04-29 14:20:03 +02:00
Jacek Sieka c847fc3ec7
Merge pull request #5 from status-im/xml-report
write junit test reports as a command line option
2021-04-28 13:44:05 +02:00
Jacek Sieka 60855d9432
add option to disable command line parsing 2021-04-28 10:19:23 +02:00
Jacek Sieka 133d86a58e
compat fixes
evaluate name once only
2021-04-27 20:29:59 +02:00
Jacek Sieka 0bff52a779
fix time, run test in block 2021-04-27 17:41:56 +02:00
Jacek Sieka d070a24fd0
write junit test reports as a command line option
* add counters to xml reports
* add command line args to write xml report
* fix initialization being performed once for each test
* use monotonic timer for duration measurements
2021-04-27 16:34:39 +02:00
Jacek Sieka e788deab3d
Merge pull request #4 from status-im/failfix
fix stand-alone "check" for <Nim-1.4.0
2021-03-22 20:44:58 +01:00
Ștefan Talpalaru 72a6ae5ce6
fix stand-alone "check" for <Nim-1.4.0
and prevent a theoretical integer overflow
2021-03-22 20:01:37 +01:00
Jacek Sieka 06063acac7
Merge pull request #3 from status-im/ci
CI setup
2021-03-21 09:33:05 +01:00
Ștefan Talpalaru 50c3aff5be
CI setup
Tests moved to "config.nims", to avoid building and using Nimble.

fix for >=Nim-1.4.0

Nim devel fix

macOS fix

fix Windows (uninitialised locks)
2021-03-19 23:22:19 +01:00
Jacek Sieka 4241a66ff4
updates (#2)
* update to latest upstream
* fix exception tracking
* update readme
2021-03-19 18:27:25 +01:00
Ștefan Talpalaru de86d8c0a8
docs: update URL after repo move 2021-03-17 17:29:39 +01:00
Ștefan Talpalaru f45023103e
Merge pull request #1 from narimiran/fix-exclamation
proc `!` was deprecated since Nim 0.18, and it doesn't exist in Nim 1.4
2020-09-08 14:49:48 +02:00
narimiran 13607032e9 proc `!` was deprecated since Nim 0.18, and it doesn't exist in Nim 1.4 2020-09-08 14:40:45 +02:00