Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

test(chatlog): add test for chatlog module #5935

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bodwok
Copy link
Contributor

@bodwok bodwok commented Nov 22, 2019


This change is Reviewable

@bodwok bodwok changed the title test(chatlog):add test for chatlog module test(chatlog): add test for chatlog module Nov 22, 2019
@sudden6
Copy link
Member

sudden6 commented Nov 22, 2019

Hi, thanks for adding more tests to qTox, two questions though:

  1. can you describe a bit what you want to test with this testcases
  2. why is the test already failing?

@bodwok
Copy link
Contributor Author

bodwok commented Nov 22, 2019

Hello, in this test, I want to check the behavior of the Chatlog module when making changes to it or to other modules

Now this test only checks the position when inserting a new messages at bottom and the number of messages inserted

This test must pass after solving #5922, #5882

@anthonybilinski
Copy link
Member

Running on Travis, the test aborts after just a few ms:
6/16 Test #6: test_chatlog .....................***Exception: Child aborted 0.19 sec

but running locally, the test runs for a little over 7s. This might be because the test spawn a graphical window on my system, which travis probably doesn't support. I don't think running graphical CI is something we can support anytime soon :( Is it possible to test scroll behaviour only through examining class state, without requiring a graphical backend?

Also running with my PR #5939, scroll behaviour seems to me to work correctly, but the test fails with:

$ ./test_chatlog
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
********* Start testing of TestChatlog *********
Config: Using QtTest library 5.12.4, Qt 5.12.4 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 9.2.1 20190909)
PASS   : TestChatlog::initTestCase()
QDEBUG : TestChatlog::insertChatlineAtBottomTest() "Loading settings from /home/abilinski/.config/tox/qtox.ini"
QWARN  : TestChatlog::insertChatlineAtBottomTest() Failed to open file (using defaults): ":themes/default/chatArea/innerStyle.css"
QWARN  : TestChatlog::insertChatlineAtBottomTest() Failed to open default file: ":themes/default/"
QWARN  : TestChatlog::insertChatlineAtBottomTest() Failed to open file (using defaults): ":themes/default/chatArea/innerStyle.css"
QWARN  : TestChatlog::insertChatlineAtBottomTest() Failed to open default file: ":themes/default/"
FAIL!  : TestChatlog::insertChatlineAtBottomTest() Compared values are not the same
   Actual   (scrollVal)     : 891
   Expected (scbar->value()): 1435
   Loc: [/home/abilinski/builds/qTox/test/chatlog/chatlog_test.cpp(91)]
PASS   : TestChatlog::cleanupTestCase()
Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 7133ms
********* Finished testing of TestChatlog *********

do you think this is a test issue? or is there a bug with #5939?

@bodwok
Copy link
Contributor Author

bodwok commented Nov 26, 2019

Without graphical backend run this test possible if separate the Chatlog on logical and graphic module. Otherwise this can be used for manual testing.

In you case scroll value before insert messages - 891, and value after insert - 1435. It seems that the slider was in the center, and after inserting attached to the bottom.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants