מתקשות בהרצת בדיקות על מערכת WSL2 שלי

Do you mean running something like this fails locally for you?

~/work/discourse [main] $ rspec spec/system/user_activity_bookmarks_spec.rb

Randomized with seed 38950
...

Finished in 7.71 seconds (files took 2.5 seconds to load)
3 examples, 0 failures

Thank you so much! I’ve approved the PR and will merge it shortly.

3 לייקים

Yes,

Only my test works.
Tested on WSL2, Ubuntu 22.

(base) arkshine@HOME:~/discourse$ rspec spec/system/user_activity_bookmarks_spec.rb

Finished in 28.13 seconds (files took 4.64 seconds to load)
4 examples, 3 failures

Failed examples:

rspec ./spec/system/user_activity_bookmarks_spec.rb:36 # User activity bookmarks can filter the list of bookmarks from the URL
rspec ./spec/system/user_activity_bookmarks_spec.rb:43 # User activity bookmarks can filter the list of bookmarks
rspec ./spec/system/user_activity_bookmarks_spec.rb:50 # User activity bookmarks can clear the query

No bookmarks are registered for some reasons:

לייק 1

Any failure message after your tests fail?

אין שגיאה.הנה הפלט כולו:

(base) arkshine@HOME:~/discourse$ rspec spec/system/user_activity_bookmarks_spec.rb
אזהרה: הגדרות או דוגמאות לא פתורות או מעורפלות במהלך Gem::Specification.reset:
      optimist (>= 3.0.0)
      גרסאות זמינות/הותקנות של הגם:
      - 3.2.1
      - 3.2.0
      rdoc (>= 4.0.0)
      גרסאות זמינות/הותקנות של הגם:
      - 6.12.0
      - 6.6.3.1
אזהרה: ניקוי הגדרות לא פתורות. נסו 'gem cleanup <gem>'
אנא דווח על באג אם זה גורם לבעיות.

אקראי עם מפתח 5318
unknown OID 931304: נכשלה בזיהוי סוג של 'embeddings'. הוא יטופל כמשתנה מחרוזת.
FFF.

כשלונות:

  1) משתמש פעילות תוויות אפשרויות לסנן את רשימת התוויות
     כשל/שגיאה: super
     
     Capybara::ElementNotFound:
       לא הצליח למצוא שדה "bookmark-search" שאינו מושבת
     
     [תמונת מסך]: /home/arkshine/discourse/tmp/capybara/failures_r_spec_example_groups_user_activity_bookmarks_can_filter_the_list_of_bookmarks_300.png

     ~~~~~~~ רישומי JS ~~~~~~~
     ~~~~~ סיום רישומי JS ~~~~~~~
     
     # ./spec/system/page_objects/pages/user_activity_bookmarks.rb:29:ב `fill_in_search'
     # ./spec/system/page_objects/pages/user_activity_bookmarks.rb:14:ב `search_for'
     # ./spec/system/user_activity_bookmarks_spec.rb:44:ב `block (2 levels) in <main>'

  2) משתמש פעילות תוויות אפשרויות לסנן את רשימת התוויות מתוך ה-URL
     כשל/שגיאה: מצפה `#<PageObjects::Pages::UserActivityBookmarks:0x00007f3d48e29f28>.has_topic?(#<Topic id: 917, title: "זהו נושא בדיקה 0", last_posted_at: nil, created_at: "2025-03-21 02:48:...oad_id: nil, slow_mode_seconds: 0, bannered_until: nil, external_id: nil, visibility_reason_id: nil>)` להיות אמיתי, התקבל שקר
     
     [תמונת מסך]: /home/arkshine/discourse/tmp/capybara/failures_r_spec_example_groups_user_activity_bookmarks_can_filter_the_list_of_bookmarks_from_the_url_846.png

     ~~~~~~~ רישומי JS ~~~~~~~
     ~~~~~ סיום רישומי JS ~~~~~~~
     
     # ./spec/system/user_activity_bookmarks_spec.rb:40:ב `block (2 levels) in <main>'

  3) משתמש פעילות תוויות אפשרויות לנקות את השאילתה
     כשל/שגיאה: super
     
     Capybara::ElementNotFound:
       לא הצליח למצוא שדה "bookmark-search" שאינו מושבת
     
     [תמונת מסך]: /home/arkshine/discourse/tmp/capybara/failures_r_spec_example_groups_user_activity_bookmarks_can_clear_the_query_761.png

     ~~~~~~~ רישומי JS ~~~~~~~
     ~~~~~ סיום רישומי JS ~~~~~~~
     
     # ./spec/system/page_objects/pages/user_activity_bookmarks.rb:29:ב `fill_in_search'
     # ./spec/system/page_objects/pages/user_activity_bookmarks.rb:14:ב `search_for'
     # ./spec/system/user_activity_bookmarks_spec.rb:51:ב `block (2 levels) in <main>'

הסתיים ב-21.11 שניות (קבצים נטלו 5.2 שניות לטעינה)
4 דוגמאות, 3 כשלונות

הדוגמאות שנכשלו:

rspec ./spec/system/user_activity_bookmarks_spec.rb:43 # משתמש פעילות תוויות אפשרויות לסנן את רשימת התוויות
rspec ./spec/system/user_activity_bookmarks_spec.rb:36 # משתמש פעילות תוויות אפשרויות לסנן את רשימת התוויות מתוך ה-URL
rspec ./spec/system/user_activity_bookmarks_spec.rb:50 # משתמש פעילות תוויות אפשרויות לנקות את השאילתה

אקראי עם מפתח 5318

did you try having a quick look at the pictures, I wonder if they offer a clue at why the test runner is not working.

(also kind of disappointed our ai bot has not nagged us to open a new topic yet ;p)

edit problem solved…

2 לייקים

I put a sleep in a test and started rspec with SELENIUM_HEADLESS=0.
I found that I can see the topics created, BUT I can’t access them.
That explains why I don’t see the bookmarks!

Immediately, it reminds me of an issue I encountered every time I made tests in TC or ran existing tests: if there is a fab topic without a defined category, I can’t access it in the tests.

So, If I do the following:

I see the bookmarks:

And the tests are working:
image

It’s unclear why it happens in my environment.
There are a lot of fab topics without categories specified in the core tests, and the tests work on GitHub. What is the difference?