Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Test installer #57
Test installer #57
Changes from 3 commits
5625a4b
98d1678
8dc6f91
817cbdd
8993514
76a8664
1327f64
fc602b5
529b811
0b7a85b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine to start off but we really need to cache all these to get any benefit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about
functools.lru_cache
, available in python https://docs.python.org/3/library/functools.html?highlight=lru_cache#functools.lru_cacheThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mean caching the result of postchunk/interchunk/etc. I mean keeping the objects around to avoid initialization costs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should probably ensure that
lt-proc
doesn't already exist. It should also test for all the binaries, not justlt-proc
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain a bit more
Since the
installer
is installingapertium-all-dev
, I am assuming all of the binaries to be available in the packages. I am checking existence oflt-proc
as its the most used binaryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer all the ones we use to be tested. Tests should assume as little as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I've over ridden the constructor, installation process is repeated 8 times while running tests https://travis-ci.com/apertium/apertium-python/jobs/221738455#L1714. What's the reason behind this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure but you don't need to make each assert its own test. They can all be one test where you loop through the binaries you expect. Also, I would check that they don't exist before installation. Otherwise, you can't be certain your installation actually did anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The binaries would be available after running the installer. Should I create an
uninstaller
as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I don't think there's a good way to test this particular aspect then. Or at least I can't think of one atm. I don't think it's worth the effort to create an uninstaller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment that notes that this test doesn't actually test as much as it might seem to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the current name is misleading. Should I rename it to
test_apertium_binaries