Skip to content

Commit

Permalink
Bug fix for test case execution
Browse files Browse the repository at this point in the history
 The CI scripts execute unstable tests although it is intended to run only the stable ones. The reason for this is that "stable" is a substring of "unstable" and hence "unstable" tests must be excluded explicitly.

Additionally, KStars UI test case initialization fails if the location of the last test wasn't Greenwich. This is corrected in the meridian flip state test case.
  • Loading branch information
sterne-jaeger committed Oct 12, 2022
1 parent 14def4e commit bfc16d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ build-and-test-stable:
- apt install -y --no-install-recommends dbus-x11
- export $(dbus-launch)
- dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
- xvfb-run ctest -T test -L stable --output-on-failure
- xvfb-run ctest -T test -L stable -LE unstable --output-on-failure
after_script:
- pwd
- saxon-xslt -u $(find . -name Test.xml) https://raw.githubusercontent.com/rpavlik/jenkins-ctest-plugin/master/ctest-to-junit.xsl > ./junit_result.stable.xml
Expand Down
2 changes: 1 addition & 1 deletion Tests/kstars_ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ADD_CUSTOM_COMMAND( TARGET test_ekos_meridianflip_specials POST_BUILD
ADD_EXECUTABLE( test_ekos_meridianflipstate ${KSTARS_UI_EKOS_SRC} test_ekos_helper.cpp test_ekos_meridianflipstate.cpp)
TARGET_LINK_LIBRARIES( test_ekos_meridianflipstate ${TEST_LIBRARIES})
ADD_TEST( NAME TestEkosMeridianFlipState COMMAND test_ekos_meridianflipstate )
# SET_TESTS_PROPERTIES( TestEkosMeridianFlipState PROPERTIES LABELS "unstable;ui" TIMEOUT 120 )
SET_TESTS_PROPERTIES( TestEkosMeridianFlipState PROPERTIES LABELS "unstable;ui" TIMEOUT 120 )

ADD_EXECUTABLE(test_ekos_scheduler ${KSTARS_UI_EKOS_SRC} test_ekos_scheduler.cpp)
TARGET_LINK_LIBRARIES(test_ekos_scheduler ${KSTARS_UI_EKOS_LIBS})
Expand Down
6 changes: 3 additions & 3 deletions Tests/kstars_ui/test_ekos_meridianflipstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void TestEkosMeridianFlipState::testMeridianFlip_data()
QTest::addColumn<bool>("upper"); /*!< upper culmination? */
QTest::addColumn<double>("offset"); /*!< meridian flip offset (in degrees) */

for (auto loc: {"Greenwich", "Cape Town"})
for (auto loc: {"Cape Town", "Greenwich"})
{
QTest::newRow(QString("loc=%1 enabled=no").arg(loc).toLatin1()) << loc << false << false << true << 0.0;
QTest::newRow(QString("loc=%1 enabled=yes, capture=no").arg(loc).toLatin1()) << loc << true << false << true << 0.0;
Expand Down Expand Up @@ -233,8 +233,8 @@ void TestEkosMeridianFlipState::init()
expectedMeridianFlipMountStates.clear();
expectedMountStates.clear();

// run 10x as fast
KStarsData::Instance()->clock()->setClockScale(10.0);
// run 50x as fast
KStarsData::Instance()->clock()->setClockScale(50.0);
// start the clock
KStarsData::Instance()->clock()->start();
// initialize the state machine
Expand Down

0 comments on commit bfc16d5

Please sign in to comment.