calliope-edu / CalliopEO_AstroPi

MIT License
1 stars 2 forks source link

CallopEO.py testing #17

Closed rzbrk closed 3 years ago

rzbrk commented 3 years ago

Currently, there is no straight forward way to test CalliopEO.py. Unfortunately, the script or functions are not object-oriented which makes the usage of tools like unittest a little tricky.

I would recommend to establish a bash script for testing, which we could name testing.sh. This script itself can source a couple of files in a subdirectory. The very first file to source could be a config file (00_config.sh) to set up any bash variable needed for testing. For every test case, we can establish a dedicated file NN_testcase_name.sh, where NN is a number defining the order in which the test cases are executed and testcase_name can be replaced by a short name for the test case.

The test cases can be:

Each bash file for a test case should contain the following:

What are your thoughts?

rzbrk commented 3 years ago

Testing is still work in progress. I do development in the feature branch testing of my fork.

Amerlander commented 3 years ago

I just did a single test file with the following cases in one file:

I made the tests at first for checking the testcases and improve the manual tests on the astropi, so unlike in your tests in your fork there is no automated proof and it is all in a single test file.

Amerlander commented 3 years ago

I just had one issue with the testing.sh: It doesnt read the testing.conf and also in line 24 for testcase in ${tc_folder%/}/*.*; do, it fails to read this as phat and results in /*.* instead of ./testcases/*.*. So hard coding it to for testcase in ./testcases/*.*; do worked.

rzbrk commented 3 years ago

Mmh, strange ...

This only happens on my system, if executing testing.sh from outside the directory testing.sh is in. Is this the case for you? I made a change to ensure the script is executed from the right directory, see #26.

rzbrk commented 3 years ago

https://github.com/rzbrk/CalliopEO_AstroPi/blob/testing/testcases/testcases.md

Amerlander commented 3 years ago

Is now working in my test on the astro pi.