menu-traversal-refactor #109
Closed
carlos
wants to merge 24 commits from
menu-traversal-refactor into master
pull from: menu-traversal-refactor
merge into: :master
:master
:phone-ussd
:lash/stalecache
:lash/purify-max
:postgres-switch-for-tests
:copy-language-code
:lash/purify-more
:account-pin-block-v2
:lash/helpcomma
:send-input-fix
:lash/gettext
:lash/dump-format
:account-pin-block
:lash/ssh-fixes
:lash/ssh-4
:log-session-id-at-sessionid
:lash/purify
:logs-at-sessionid
:language-change-fix
:hash-pin
:menu-primary-selectors
:lash/dump-key-prefix
:force-restart-state
:restart-state-devtool
:mixed-languages
:add-space-after-colon
:link-terms-and-conditions
:lash/store-dumper
:back-state-check
:double-session-id
:profile-edit-traverse
:data-items-cleanup
:minor-bug-fixes
:lash/persister-freakout
:trigger-balance-reload
:lash/no-persister-deadlock
:voucher-details
:single-error-node
:sohail/trace-build-29-11
:alias-address-validation
:sohail/upgrade-deps
:account-statement
:sohail/docker-build
:menu-balances
:send-node
:profile-edit-show
:terminal-logs
:readme-documentation
:africastalking-endpoint
:http-logs
:log-file
:swahili-templates-menu
:api-error-fix
:lash/export-to-term
:pre-mock-remove
:remove-db-mocks
:pin-reset
:tests-refactor
:consolidate-temp-data-storage
:profile-update-pin-check
:voucher-data
:lash/reverse-session
:address-sessionId
:menu-voucherlist
:api-context
:api-structs
:send-menu-update
:check-balance-update
:postgres-switch
:menu-api-errors
:menu-traversal-v2
:psql-switch
:menu-traversal-refactor
:menu-traversals
:lash/subprefix
:tests-update
:menu-profile-edit
:fix-repeated-nodes
:wip-menu-select-fix
:lash/ssh
:go-vise-0.2.0
:wip-main-refactor
:at-return-output
:wip-unit-tests
:wip-pin-guard
:change-language
:wip-menu-help
:wip-pin-reset
:lash/vise-make-var
:lash/async-driver
:menu-options
:unit-tests
:wip-code-check
:lash/draft-dev-0.1.0
:wip-go-vise-dev-0.1.0
: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 labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
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.
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