×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Problems with unit tests

  • Posts: 82
  • Thank you received: 25
Hi, I'm just setting up a dev environment to try some things with KStars and I've hit a couple of issues with the unit tests on a clean build:
  1. Some unit tests eg. TestPlaceholderPath, TestPolarAlign failed to find the test data files - I had to link these to files in the build/bin directory:
    9filters.esq -> ../Tests/scheduler/9filters.esq
    ngc4535-autofocus1.fits -> ../Tests/polaralign/ngc4535-autofocus1.fits
    ngc4535-autofocus2.fits -> ../Tests/fitsviewer/ngc4535-autofocus2.fits
    ngc4535-autofocus3.fits -> ../Tests/fitsviewer/ngc4535-autofocus3.fits
    testFlexibleNamingChangeBehavior_data_small.csv -> ../Tests/capture/testFlexibleNamingChangeBehavior_data_small.csv
    testFlexibleNaming_data_small.csv -> ../Tests/capture/testFlexibleNaming_data_small.csv
    testFullNamingSequence_data_small.csv -> ../Tests/capture/testFullNamingSequence_data_small.csv
    testSchedulerProcessJobInfo_data.csv -> ../Tests/capture/testSchedulerProcessJobInfo_data.csv
  2. Test TestFitsData::testComputeHFR (NGC4535-3-NORMAL) fails. It finds 29 stars instead of the expected 30.
Are these bugs in the tests or have I messed up somewhere?
I'd like to have a clean reference before I start digging into the code.
Thanks
Ed
1 year 10 months ago #82977

Please Log in or Create an account to join the conversation.

  • Posts: 1208
  • Thank you received: 559

Replied by Hy Murveit on topic Problems with unit tests

Ed,

When I run unit tests locally, I find I often have to run them in their $BUILD/Tests/$TEST_DIR directory.
So, for instance, in my case that would be:

```
cd ~/Projects/kstars-build/Tests/polaralign
../../bin/test_polar_align
```

I'm honestly not sure what the testing environment does when it runs its testing pipeline.
You can see a pipeline output, for instance, by looking at the pipeline link in an MR.
Here's my latest MR: invent.kde.org/education/kstars/-/merge_requests/628
and you can see a pipeline link on that page, which is also here: invent.kde.org/education/kstars/-/pipelines/178754
You should see that my MR passed all the "stable" tests, but had some issues with tests marked "unstable".

Interestingly, I didn't see any reference to TestFitsData in the pipeline output, not sure why.
I just tried to run that test, and also got failures, so it isn't you.
Clearly we need to look at it. Someone must have disabled it.
Don't have time to look right now.

Be aware that we don't have great test coverage, though it has been improved in the past year. It is certainly an area that would be great to improve.

Thank you for looking into things, and looking forward to see what you come up with.
Hy
The following user(s) said Thank You: Ed Lee
1 year 10 months ago #82991

Please Log in or Create an account to join the conversation.

  • Posts: 82
  • Thank you received: 25

Replied by Ed Lee on topic Problems with unit tests

Thanks Hy. Glad it's not me.
1 year 10 months ago #82992

Please Log in or Create an account to join the conversation.

Time to create page: 0.417 seconds