menu-traversal-refactor #109
Closed
carlos
wants to merge 24 commits from
menu-traversal-refactor into master
pull from: menu-traversal-refactor
merge into: urdt:master
urdt:master
urdt:phone-ussd
urdt:lash/stalecache
urdt:lash/purify-max
urdt:postgres-switch-for-tests
urdt:copy-language-code
urdt:lash/purify-more
urdt:account-pin-block-v2
urdt:lash/helpcomma
urdt:send-input-fix
urdt:lash/gettext
urdt:lash/dump-format
urdt:account-pin-block
urdt:lash/ssh-fixes
urdt:lash/ssh-4
urdt:log-session-id-at-sessionid
urdt:lash/purify
urdt:logs-at-sessionid
urdt:language-change-fix
urdt:hash-pin
urdt:menu-primary-selectors
urdt:lash/dump-key-prefix
urdt:force-restart-state
urdt:restart-state-devtool
urdt:mixed-languages
urdt:add-space-after-colon
urdt:link-terms-and-conditions
urdt:lash/store-dumper
urdt:back-state-check
urdt:double-session-id
urdt:profile-edit-traverse
urdt:data-items-cleanup
urdt:minor-bug-fixes
urdt:lash/persister-freakout
urdt:trigger-balance-reload
urdt:lash/no-persister-deadlock
urdt:voucher-details
urdt:single-error-node
urdt:sohail/trace-build-29-11
urdt:alias-address-validation
urdt:sohail/upgrade-deps
urdt:account-statement
urdt:sohail/docker-build
urdt:menu-balances
urdt:send-node
urdt:profile-edit-show
urdt:terminal-logs
urdt:readme-documentation
urdt:africastalking-endpoint
urdt:http-logs
urdt:log-file
urdt:swahili-templates-menu
urdt:api-error-fix
urdt:lash/export-to-term
urdt:pre-mock-remove
urdt:remove-db-mocks
urdt:pin-reset
urdt:tests-refactor
urdt:consolidate-temp-data-storage
urdt:profile-update-pin-check
urdt:voucher-data
urdt:lash/reverse-session
urdt:address-sessionId
urdt:menu-voucherlist
urdt:api-context
urdt:api-structs
urdt:send-menu-update
urdt:check-balance-update
urdt:postgres-switch
urdt:menu-api-errors
urdt:menu-traversal-v2
urdt:psql-switch
urdt:menu-traversals
urdt:lash/subprefix
urdt:tests-update
urdt:menu-profile-edit
urdt:fix-repeated-nodes
urdt:wip-menu-select-fix
urdt:lash/ssh
urdt:go-vise-0.2.0
urdt:wip-main-refactor
urdt:at-return-output
urdt:wip-unit-tests
urdt:wip-pin-guard
urdt:change-language
urdt:wip-menu-help
urdt:wip-pin-reset
urdt:lash/vise-make-var
urdt:lash/async-driver
urdt:menu-options
urdt:unit-tests
urdt:wip-code-check
urdt:lash/draft-dev-0.1.0
urdt:wip-go-vise-dev-0.1.0
urdt:wip-flag-migration
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
cleanup
devops
documentation
easypeasy
exchange
i18n
legacy
meta
migration
optimization
privilege
refactor
smell
support
tooling
ux
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Activity
Doing
An item actively being worked on currently
Activity
Hold
Not being actively worked on
Activity
Proposal
A proposal for a new feature or enhancement
Activity
QA
Ready for QA testing
Activity
Validate
Dev team validating changes
Runner
AT
Runner
CLI
Runner
HTTP
Runner
SSH
A task that can be completed with little effort
relating to swapping of assets and offramps
Languages and translations
Legacy features from the old ussd system to be ported
container for other issues
features that have to do with special, privileged axx
Code smell
transparency and help with exception states
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: urdt/ussd#109
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "menu-traversal-refactor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Introduction of the menu traversal tests for the core menu nodes
@@ -0,0 +31,4 @@return sessionsData, err}func CreateTestCases(group DataGroup) []struct {I prefer typedef instead of inline structs, the latter is hard to read.
should this be an extension of StepTest?
Created a TestCase struct for generating the test cases: Commit :
810dd74e43.@@ -0,0 +1,55 @@package driverplease remove space in filename
Updated by commit:
3afe35b44f,the setup driver functionality is now in the group driver.@@ -0,0 +6,4 @@"os")type Step struct {aren't these structs more or less the same as in the groupdriver.go
can't we just reuse the definitions?
Updated by commit:
3afe35b44f,the setup driver functionality is now in the group driver.@@ -0,0 +36,4 @@return sessions}func FilterGroupsByName(groups []Group, name string) []Group {Can we please use regex here, match start of string
@@ -0,0 +1,111 @@package enginecan we hide all of this under internal/testutil or something?
Also, I don't think we need a subdirectory engine/ for this, unless there is a specific point to it?
This has now been moved to internal/testutil
This has now been moved to internal/testutil. Commit:
96aec1fd67@@ -0,0 +2,4 @@package engineconst OnlineTestEnabled = falseI would just define the accountservice as a global directly here, instead of the detour of defining a variable
@@ -1 +1 @@Confirm your new PIN:Confirm your new PIN:no visible change. stray non-printable char?
@@ -18,3 +19,4 @@ INCMP enter_yob 4INCMP enter_location 5INCMP enter_offerings 6INCMP view_profile 7remove all blank lines please
The blank line is required to be able to compile the .vis files,Without this,we would get an 'EOF' error.
@@ -0,0 +76,4 @@t.Fatalf("Test case '%s' failed during Flush: %v", group.Name, err)}b := w.Bytes()if !bytes.Equal(b, []byte(step.ExpectedContent)) {Can you please implement the check as a function of the step struct (in reality, any struct that has
ExpectedContent), and use regex for the match check instead?The latter will enable us to have more flexible match criteria, as having literal checks everywhere will make it impossible to test dynamic data.
@@ -0,0 +83,4 @@}}// Adding a sleep after the test to wait for registration to complete the processtime.Sleep(5 * time.Second)Only if run online right?
Can we make this a callback that could theoretically listen to an event channel instead? That means, abstract the wait for result (and in the case of offline test no wait).
@lash ,So the idea for this would be to setup an event channel in the TestEngine that would block the other test calls for 5 seconds ,if the online tag is defined.For reference and input:
96aec1fd67@@ -0,0 +27,4 @@ctx = context.WithValue(ctx, "SessionId", sessionId)pfp := path.Join(scriptDir, "pp.csv")var eventChannel = make(chan bool)My intuition tells me that having an abstraction of the account service
TestAccountServicethat includes a methodWaitForAccountwould be easier to understand down the road.Also, please see the comment about not using vars but instead setting that testaccountservice object explicitly as a global variable.
If this is unclear, I can try to explain better with an example if needed.
@lash ,For clarity,you mind giving a simple example for using the testaccountservice globally?
lash referenced this pull request2024-10-18 15:27:15 +02:00
obsoleted by #115
Pull request closed