-
Notifications
You must be signed in to change notification settings - Fork 22
ADD: Tests for Google Drive and AWS Connection Methods #570
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
Conversation
Hey @JoeZiminski, for some reason, the tests are still failing due to invalid credentials. Can you check the github secrets again and make sure they are correct and their variable names are the same as that in |
Thanks @cs7-shrey I'll look into this now |
Hey @JoeZiminski, I couldn't understand this part of code from #572 def check_if_aws_bucket_exists(cfg: Configs) -> bool:
if bucket_name != "" and bucket_name not in names: # TODO: CHECK
return False
return True Why do we return |
Hey @cs7-shrey sorry I just hacked that together and was operating under a bad assumption. For In this case, that code and the changes to |
Cool @JoeZiminski! I'll revert changes to that function. Just to be on the same page, you're talking about reverting the central path being |
Hi @cs7-shrey that's what I meant (so |
* Use different folder name per tests. * Play around with AWS see if it works. * Edit workflow.
f2044cc
to
d92b360
Compare
Hi @cs7-shrey sorry related to your question about the long test-times. Currently we run the tests under two schedules, the one of the PRs runs only the first and latest python, while another runs weekly on all version
We could extend this to write an environment variable like |
Could I suggest that all the tests should be run every time? It might be worth cutting down the parametrisation and/or trying to speed the tests up, but in my experience, tests that aren't run may as well not exist. It's really easy to ignore scheduled tests, or ones that need to be run manually. The GH actions test matrix runs in parallel anyway. |
Hey @JoeZiminski @adamltyson, the google drive tests are indeed slow (as they were on my device) but on github actions they are significantly faster. Even then, the total time for which the tests are run will eventually blow up as this gets merged into main and more and more tests keep getting added. So, in my opinion it might be worth thinking a strategy for that (not much of a concern right now but more so in the future), |
Also, @JoeZiminski, I've written all the tests I could think of. If you think of adding any more tests, do let me know. If this seems fine, I'll proceed to write docstrings for tests and functions written in this PR. |
Awesome, thanks @cs7-shrey! I will review this ASAP. Good point @adamltyson we can think of ways to speed up these tests where possible and explore any alternatives to splitting the tests in that way. |
Co-authored-by: Joe Ziminski <[email protected]>
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.
Hey @cs7-shrey this is excellent, I don't think it could be any neater or more centralized. I've added a few suggestions here and there, very minor stuff mostly around consistency with existing code conventions. After taking a look at these suggestions this will be good to go!
Co-authored-by: Joe Ziminski <[email protected]>
for more information, see https://pre-commit.ci
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.
Awesome! thanks @cs7-shrey The SonarCloud is failing for a non-reason, are you able to see it? Basically in the google drives / aws tests TestTuiGdriveConfigs and the similar AWS test there is quite a lot of similar code and it is complaining about duplication. But, these are tests and I think it is more readable as it is, so there is no need to change it. Unfortunately I can't override it but will just merge, it won't make a difference going forward.
* add: gdrive and aws transfer tests * add: tui tests for setting up gdrive and aws connections * add: setup env variables from github secrets in the workflow file * Minor changes for null central path and distinct folders (#572) * Use different folder name per tests. * Play around with AWS see if it works. * Edit workflow. * fix: handle None central_path in tempfile path and correct aws bucket checking logic * fix: location constraint, add: failure test for aws setup via tui * minor change * add: gdrive tui connection setup failure tests * add: switch connection radiobutton test * extend: update tui config test for gdrive and aws * pre-commit: formatting * edit: code_test_and_deploy.yml * add: backwards compability tests for config.yaml * add: unit test for gdrive preliminary setup * Revert handling None case in get_aws_bucket_name * refactor: code_test_and_deploy.yml * Apply suggestions from code review Co-authored-by: Joe Ziminski <[email protected]> * fix: env in tui tests * use inbuilt rclone recursive search * add: docstrings to backwards compatiblity tests * minor changes * use rclone recursive search in ssh tests * use central function for ssh wildcard tests * fix: CI error on deleting temp.txt * add: docstrings to transfer tests * add: docstrings to tui tests * add: docstrings to unit test * remove: backwards compatibility test for incorrect configs * add: make new project configs tests for gdrive and aws * add: test for None central path in gdrive * edit: code_test_and_deploy.yml * add: central path fixtures to tui tests and tweak central path for transfer tests * fix: ci error on windows * Apply suggestions from code review Co-authored-by: Joe Ziminski <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add extra check to ssh setup and move message template function to tui_utils.py * fix: typo --------- Co-authored-by: Joe Ziminski <[email protected]> Co-authored-by: JoeZiminski <[email protected]> Co-authored-by: Shrey Singh <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* add: gdrive and aws transfer tests * add: tui tests for setting up gdrive and aws connections * add: setup env variables from github secrets in the workflow file * Minor changes for null central path and distinct folders (#572) * Use different folder name per tests. * Play around with AWS see if it works. * Edit workflow. * fix: handle None central_path in tempfile path and correct aws bucket checking logic * fix: location constraint, add: failure test for aws setup via tui * minor change * add: gdrive tui connection setup failure tests * add: switch connection radiobutton test * extend: update tui config test for gdrive and aws * pre-commit: formatting * edit: code_test_and_deploy.yml * add: backwards compability tests for config.yaml * add: unit test for gdrive preliminary setup * Revert handling None case in get_aws_bucket_name * refactor: code_test_and_deploy.yml * Apply suggestions from code review Co-authored-by: Joe Ziminski <[email protected]> * fix: env in tui tests * use inbuilt rclone recursive search * add: docstrings to backwards compatiblity tests * minor changes * use rclone recursive search in ssh tests * use central function for ssh wildcard tests * fix: CI error on deleting temp.txt * add: docstrings to transfer tests * add: docstrings to tui tests * add: docstrings to unit test * remove: backwards compatibility test for incorrect configs * add: make new project configs tests for gdrive and aws * add: test for None central path in gdrive * edit: code_test_and_deploy.yml * add: central path fixtures to tui tests and tweak central path for transfer tests * fix: ci error on windows * Apply suggestions from code review Co-authored-by: Joe Ziminski <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add extra check to ssh setup and move message template function to tui_utils.py * fix: typo --------- Co-authored-by: Joe Ziminski <[email protected]> Co-authored-by: JoeZiminski <[email protected]> Co-authored-by: Shrey Singh <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
This PR adds tests for Google Drive and AWS connection methods including tests for transfers, TUI and unit tests for certain functions.
Checklist: