Skip to content

v11/Remove Fake Query -> Query::TestCaseStartedByTestCase#1854

Open
luke-hill wants to merge 6 commits intov11/remove_fake_queryfrom
refactor/isolate_attempt_count_to_query
Open

v11/Remove Fake Query -> Query::TestCaseStartedByTestCase#1854
luke-hill wants to merge 6 commits intov11/remove_fake_queryfrom
refactor/isolate_attempt_count_to_query

Conversation

@luke-hill
Copy link
Copy Markdown
Contributor

Description

This is a WIP to begin to isolate out the fake query Query::TestCaseStartedByTestCase

Type of change

Please delete options that are not relevant.

  • Refactoring (improvements to code design or tooling that don't change behaviour)

Please add an entry to the relevant section of CHANGELOG.md as part of this pull request.

Checklist:

Your PR is ready for review once the following checklist is
complete. You can also add some checks if you want to.

  • Tests have been added for any changes to behaviour of the code
  • New and existing tests are passing locally and on CI
  • bundle exec rubocop reports no offenses
  • RDoc comments have been updated
  • CHANGELOG.md has been updated


# Query missing
# find_test_case_started_by_test_case_id
attempts_made_new =
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mpkorstanje Need your thoughts here.

I'm looking to find out what attempt I am on. The way I do this is to do the following.....

  1. Find all test_case_started messages
  2. Filter and only obtain the messages where the test_case_id equals the current event test case id (Current event ids are congruent to the message ids), then return the attempt
  3. For this array of attempts, return the largest value

This in theory could be a query method. But I am querying using an id, not a message object. Furthermore, because this event is triggered and I want to find out information on itself, it can be nil.

The results I obtain are again shifted out by a value of 1. i.e. my new methodology returns me 0/1/2 whereas the message returns me 1/2/3

Questions)

  • Should this be a query method. If so how do we construct it - because in some situations I won't have a message (I suppose in the situations I have no message, I can assume attempt is 1?)
  • Should I be aiming to scan using a message, if so what message should I be using?

@luke-hill luke-hill changed the title v11/Remove Fake Query -> Add fake query constant to generate new way of calculating attempts v11/Remove Fake Query -> Query::TestCaseStartedByTestCase Apr 8, 2026
@@ -376,7 +382,8 @@ def on_undefined_parameter_type(event)
end

def test_case_started_id(test_case)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is used in over 10 locations.

It "might" be that each of those locations can use a better implementation instead of going around the houses. But for now this works

Copy link
Copy Markdown
Contributor Author

@luke-hill luke-hill left a comment

Choose a reason for hiding this comment

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

This is overwriting the test cases so I only have 1 test case for n iterations of a test

@luke-hill luke-hill changed the base branch from main to v11/remove_fake_query April 9, 2026 09:23
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.

1 participant