-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Added method in python runner to get eventNumber for TC-SMOKECO tests #28704
Added method in python runner to get eventNumber for TC-SMOKECO tests #28704
Conversation
PR #28704: Size comparison from 8060222 to 65d4f29 Increases (1 build for bl702l)
Decreases (1 build for efr32)
Full report (62 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not believe reading logs is a sustainable approach. Our runners have access to the entire stack in theory, so it should be able to install appropriate callbacks or subscriptions to receive events and keep track of them.
PR #28704: Size comparison from 8060222 to 7874d39 Increases above 0.2%:
Increases (3 builds for linux, nrfconnect)
Decreases (1 build for cc32xx)
Full report (12 builds for cc32xx, k32w, linux, mbed, nrfconnect, qpg)
|
PR #28704: Size comparison from 8060222 to e1bbbc3 Increases above 0.2%:
Increases (9 builds for bl702l, linux, nrfconnect, psoc6, telink)
Decreases (14 builds for bl702, bl702l, cc32xx, efr32, esp32, linux, psoc6)
Full report (62 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
PR #28704: Size comparison from 8060222 to 923ea3c Increases above 0.2%:
Increases (10 builds for esp32, linux, nrfconnect, psoc6, telink)
Decreases (32 builds for bl702, bl702l, cc32xx, efr32, esp32, linux, psoc6, qpg, telink)
Full report (62 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving. I believe as a followup we should not have a separate per runner variable and instead we should use the variable storage
to keep track of the last event number.
…project-chip#28704) * Add method to get last event number in python * Update TC-SMOKECO tests * Retain event number when reading events * Improve the method of get event number * Restyled by autopep8 * Add variable checking * Update name --------- Co-authored-by: Hare <[email protected]> Co-authored-by: Restyled.io <[email protected]>
…project-chip#28704) * Add method to get last event number in python * Update TC-SMOKECO tests * Retain event number when reading events * Improve the method of get event number * Restyled by autopep8 * Add variable checking * Update name --------- Co-authored-by: Hare <[email protected]> Co-authored-by: Restyled.io <[email protected]>
Proposing the method to fixes #27539
Adding a method in Python runner to get eventNumber in order to get the TC-SMOKECO test to work, I understand this could not be a good implementation and may need improvement/use another alternative.
The
readEvent
command from eventTest returns a list of events. But in yaml, the value I expect needs to match the value actually returned. And the eventNumber parameter in yaml acts as a filter that allows me to accomplish this.If I know the event number before a readEvent step, I can get the latest one located and read the event generated after this eventNumber to pass the test plan, which also makes it easier for automation.
In the testing of the smoke and CO Test plan, we will verify a series of new events that are received. The EventNumber is used to distinguish whether an event is the most recent one. However, the issue lies in the fact that the EventNumber provided in the testEvents currently relies on an initial eventNumber in a configuration file. (I have set it to 0 in the config, which results in retrieving all records.)
Since I didn't find certain commands only returned the latest event sequence number. I can't do the effective update to flag the new starting point with the EventNumber to search event.
The readEvent returns a list of all corresponding events found. Due to the fact that the test plan will test multiple times for different scenarios triggering the same event, this leads to the continuous growth of the returned list... Consequently, if testing persists, the returned records will become unpredictable and lead to test failure.
Example test Ymal:
Until then, I've tried to modify EVENT_NUMBER at config and letting testers enter it manually.
But there are some issues with using the eventNumber parameter in TC-SMOKECO:
So this would need a new method to get the latest event automatically.
My logic for the change is to
last_event_number
variable to the python runner to record the latest event number of the readEvent.readEvent
with no response to let the last_event_number have a value.isLastEventNumber
parameter is true, the eventNumber parameter is set to last_event_number.This will make a method for tracking the last event number. By running tests, this method worked with the PR proposed here.