Skip to content
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

Tests performance: review network access #9

Open
1 of 2 tasks
desyncr opened this issue Feb 3, 2017 · 13 comments
Open
1 of 2 tasks

Tests performance: review network access #9

desyncr opened this issue Feb 3, 2017 · 13 comments
Assignees

Comments

@desyncr
Copy link
Member

desyncr commented Feb 3, 2017

Currently our test suite does real network access. This make test run extra slow and make them unavailable working offline.

The idea is to create some git repositories at run-time and accessing them, now that zpm supports local repositories.

TODO

  • Remove most network access in tests
  • Remove network access in remove.t tests
@fennecdjay
Copy link
Member

would'nt that mean running a local git server?

@desyncr
Copy link
Member Author

desyncr commented Feb 3, 2017

No need for that. git doesn't need a server for it (unlike, subversion). Just a couple of commands away:

$ /tmp git init test-repo
Initialized empty Git repository in /private/tmp/test-repo/.git/

Then in /tmp/test-repo you can perform all git commands you need, clone, commit.

@fennecdjay
Copy link
Member

very nice! Thanks for the tip.

@fennecdjay
Copy link
Member

so it just needs to had a *.*sh file with a hello_world function in it, then test the function?

@desyncr
Copy link
Member Author

desyncr commented Feb 3, 2017

Yeah, exactly, as we're not testing the plugins themselves, but how zpm handles the cloning, listing, removal and so forth. We'll need to have at least two of them, in order to test properly.

@desyncr
Copy link
Member Author

desyncr commented Feb 3, 2017

If we need in the future we may have specific test repositories to test special cases, such as what happens if the plugin as no "*.*sh", for example.

@fennecdjay
Copy link
Member

Yes. Shouldn't we also test wether plugins contains _xxx file, or even file with #compdef xxx for shebang?


that would probably mean reworking the plugin_entry function:
* append to fpath if there is a completion
* append to path if there are executables.
* source if there is a *.*sh file.

@fennecdjay
Copy link
Member

two more question:

-  What's the way to test completions?
-  Should'nt we use zpm directory to test both binary install and completion(once we have the ompletion file working.)?

@desyncr
Copy link
Member Author

desyncr commented Feb 3, 2017

I haven't tested completions ever. So there is a room for investigation. Maybe looking at https://github.com/zsh-users/zsh-autosuggestions would give us a clue.

@desyncr
Copy link
Member Author

desyncr commented Feb 3, 2017

Yes. Shouldn't we also test wether plugins contains _xxx file, or even file with #compdef xxx for shebang?

Yeah, those are great ideas. Should target v1.0.0.

@fennecdjay
Copy link
Member

I use zpm self install feature, which puts zpm in the PATH, along with a small (and full of sxxx)
_zpm completion file, and it works well.
To me, the question remains: how do we test it programmtically?


We should probably use gist to share _zpm file while working on it, like we did for .travis.yml

@desyncr
Copy link
Member Author

desyncr commented Feb 3, 2017

A working _zpm is better than nothing. So please go ahead and create a PR.

@desyncr desyncr self-assigned this Feb 3, 2017
@desyncr
Copy link
Member Author

desyncr commented Feb 3, 2017

I'm working on test's performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants