-
Notifications
You must be signed in to change notification settings - Fork 63
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
Write tests for the new router.ProcManager
structure.
#308
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Branch:
mainnet-dev
Prerequisites
Move
genMockApp()
from test file of/pkg/app
module to/pkg/app/apptest
: https://github.com/skycoin/skywire/blob/64860b09f102a34d78b6eae80efcaa5d7c7cba66/pkg/app/executor_test.go#L29-L49Create an empty implementation of
router.Router
.Tests
RunProc()
should:c.BinLoc
is invalid.port=0
.RunProc()
, the returned*AppProc
should:ProcID()
return1
on first process,2
in second, etc.Stopped()
returnfalse
.Stop()
, should return no error andStopped()
should then returntrue
.Proc()
should return the right*AppProc
of givenProcID
, and should return false if:RunProc
never returned such aProcID
.AppProc
is stopped.AllocPort()
should always return free ports.ProcOfPort()
should returnproc
assigned to given port only ifproc
is still running (not.Stopped()
).RangeProcIDs()
andRangePorts()
should cover all that is expected.Close()
should succeed.The text was updated successfully, but these errors were encountered: