Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Room Manager Tests #341

Closed
wants to merge 0 commits into from
Closed

Conversation

Kaspar-Metsa
Copy link
Contributor

@Kaspar-Metsa Kaspar-Metsa commented Feb 3, 2024

  1. Tests for Room Manager
  2. Fixed sometimes failing test in Timer
  3. Fixed Warning message during build

@Kaspar-Metsa Kaspar-Metsa force-pushed the room_manager-tests branch 2 times, most recently from ba2cd05 to ab2b9ec Compare February 4, 2024 08:01
@nschimme nschimme requested a review from mdrcode February 4, 2024 13:33
Copy link
Contributor

@mdrcode mdrcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this, looks good overall. My high level feedback is to add a bit more context/readability and test more end to end (like test that the overall widget works across mutations).

src/display/Infomarks.cpp Outdated Show resolved Hide resolved
@@ -76,8 +76,6 @@ void TestCTimers::testCountdownCompletion()
timers.addCountdown(countdownName.toStdString(), countdownDesc.toStdString(), countdownTimeMs);
QString countdownsListBefore = QString::fromStdString(timers.getCountdowns());
QVERIFY(countdownsListBefore.contains(countdownName)); // Verify the added countdown is present
QString countdownsList = QString::fromStdString(timers.getCountdowns());
QVERIFY(countdownsList.contains("(up for - 0:00, left - 0:10)"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove? Not arguing just looking for a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This QVERIFY failed around than 10% of runs. I don't know why. Maybe sometimes it takes a millisecond or so to see the string in the list? So waiting a bit would fix it but I do not want to use QWAIT in tests because currently our tests take 4.4sec and using qwait a lot will make tests slow. I have tried mocking the clock but since this timer is based on real system clock it is not possible to mock, the actual implementation should also be changed to a mockable clock.

What do you suggest to do here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you saying it failed in 10% of your runs locally or 10% of GH runs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sometimes failed on the server, on GH

tests/roompanel/TestRoomManager.cpp Outdated Show resolved Hide resolved
tests/roompanel/TestRoomManager.cpp Outdated Show resolved Hide resolved
tests/roompanel/TestRoomManager.cpp Outdated Show resolved Hide resolved
tests/roompanel/TestRoomManager.h Outdated Show resolved Hide resolved
tests/roompanel/TestRoomMob.cpp Outdated Show resolved Hide resolved
tests/roompanel/TestRoomMob.cpp Outdated Show resolved Hide resolved
tests/roompanel/TestRoomWidget.h Outdated Show resolved Hide resolved
@nschimme
Copy link
Contributor

nschimme commented Feb 6, 2024

Looks like there is a Mingw build failure too: https://ci.appveyor.com/project/nschimme/mmapper/builds/49106518/job/l2au3mr81nbyrcxi#L574

C:/Build/MMapper/src/configuration/configuration.cpp:985:35: error: lvalue required as left operand of assignment
     TRANSPARENT = Color(0, 0, 0, 0);
                                   ^
mingw32-make.exe[2]: *** [tests\CMakeFiles\TestRoomWidget.dir\build.make:106: tests/CMakeFiles/TestRoomWidget.dir/Unity/unity_0_cxx.cxx.obj] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:719: tests/CMakeFiles/TestRoomWidget.dir/all] Error 2
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
[ 75%] Building CXX object src/CMakeFiles/mmapper.dir/Unity/unity_23_cxx.cxx.obj
[ 76%] Building CXX object src/CMakeFiles/mmapper.dir/Unity/unity_22_cxx.cxx.obj

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a53f3d6) 51.86% compared to head (b8bd1a2) 53.66%.
Report is 1 commits behind head on master.

❗ Current head b8bd1a2 differs from pull request most recent head 731e1d8. Consider uploading reports for the commit 731e1d8 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #341      +/-   ##
==========================================
+ Coverage   51.86%   53.66%   +1.79%     
==========================================
  Files          80       89       +9     
  Lines        5202     5281      +79     
  Branches        0      460     +460     
==========================================
+ Hits         2698     2834     +136     
+ Misses       2504     2447      -57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Kaspar-Metsa
Copy link
Contributor Author

Looks like there is a Mingw build failure too: https://ci.appveyor.com/project/nschimme/mmapper/builds/49106518/job/l2au3mr81nbyrcxi#L574

C:/Build/MMapper/src/configuration/configuration.cpp:985:35: error: lvalue required as left operand of assignment
     TRANSPARENT = Color(0, 0, 0, 0);
                                   ^
mingw32-make.exe[2]: *** [tests\CMakeFiles\TestRoomWidget.dir\build.make:106: tests/CMakeFiles/TestRoomWidget.dir/Unity/unity_0_cxx.cxx.obj] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:719: tests/CMakeFiles/TestRoomWidget.dir/all] Error 2
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
[ 75%] Building CXX object src/CMakeFiles/mmapper.dir/Unity/unity_23_cxx.cxx.obj
[ 76%] Building CXX object src/CMakeFiles/mmapper.dir/Unity/unity_22_cxx.cxx.obj

Fixed!

@Kaspar-Metsa Kaspar-Metsa force-pushed the room_manager-tests branch 2 times, most recently from 731e1d8 to f72fb6f Compare February 10, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants