-
Notifications
You must be signed in to change notification settings - Fork 226
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
[Feature Request] Tests: Mock system calls & expectations instead of using on local repo #273
Comments
@ened I have a local reference flutter repo that I use as "mock" and makes things run much faster. Passing the local flutter repo as an env var |
@leoafarias Understood you have a local test repo. Does the unit test actually need a repository? Wouldn't the commands be enough? |
On the CI I run without the local cache since the time is not a priority. I implemented an AppContext in order to control them a bit more the tests as I get the coverage a bit higher. I do plan on creating a MockContext, that automatically creates/updates and uses a local referenced repo. However, I am not if mocking so you don't need the repo is a good option. FVM does not work without a flutter repository. Would have to mock all flutter and git tools which are critical pieces. |
@leoafarias agree you'd had to mock all of the interfaces with the file system & tools underneath. |
@ened I am not opposed to have a better documented interface. However it seems that this was not the purpose of the initial issue.
These are addressed by the local reference in the mock local repo. Do you want to update the goals of the issue, I think I can get aligned on the problem with you. |
@leoafarias ok updated the title, hope that is sufficient to move on. |
For future ticket reference:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is your feature request related to a problem? Please describe.
Running the test suite currently causes actual downloads & install commands.
Describe the solution you'd like
The test suite should run the commands against a mock shell / mock environment. Commands & their responses could be recorded, mocked & evaluated.
Additional context
This implies a bit of refactor in how fvm runs the commands.
This probably has to go through a
PlatformExecutor
class or similar.That class needs a test, but it will probably suffice to test
echo 123
or similar.The text was updated successfully, but these errors were encountered: