-
-
Notifications
You must be signed in to change notification settings - Fork 363
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
Key value state + tests refactoring #969
Conversation
Needed to faclitate multiple backends (like sqlite3/other remote database)
… it in state file implementation to __db
For now it's just the underlying DB, but it resembles something that can roll back the current transaction.
while backups[backup_id]['status'] == "running": | ||
time.sleep(10) | ||
backups = deployment.get_backups() | ||
deployment_run_command(deployment, "rm {}/back-me-up".format(path)) |
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.
Please run any commands via an API that uses arrays to process commands. E.g. foo(["ls","-l"])
vs foo("ls -l")
.
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.
cons:
- more characters to print
- harder to use
.format
method with multiple{}
. e.g.
deployment_run_command(deployment, "rm {}/back-me-up {}/and-me".format(path))
vs
deployment_run_command(deployment, ["rm", "{}/back-me-up".format(path), "{}/and-me".format(path)])
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 don't agree, but perhaps others do. I.e., if it was my code base, it wouldn't get in, but it's not my play ground.
# If your account doesn't support EC2-Classic, you will get an error: | ||
# `VPC DB Security Groups cannot be modified with this API version. | ||
# Please use an API version between 2012-01-15 and 2012-10-31 to modify this group.` | ||
# TODO: remove it? |
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.
Removing it seems reasonable or otherwise it should check for EC2-Classic support.
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.
@AmineChikhaoui what do you think, remove this comment and ec2-rds-dbinstance-with-sg.nix
file OR leave commented and ec2-rds-dbinstance-with-sg.nix
file for legacy?
I'm asking because you are author of this test which I can't run https://github.com/NixOS/nixops/blob/aa3602d03cd03fc748cdcf1fc25d97ef863474f0/tests/functional/ec2-rds-dbinstance-with-sg.nix
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.
Checking for classic support is less work then asking him.
from tests.functional.shared.create_deployment import create_deployment | ||
from tests.functional.shared.using_unique_state_file import using_unique_state_file | ||
|
||
parent_dir = path.dirname(__file__) |
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.
Same comments as before about __file__
NOTE: how to run testto show all tests:
to run only one test:
Proof, that tests, that changed after
|
Great that you show a limited form proof that the feature is working. 👍 I think I will leave the rest to others (because I don't have merge rights anyway). |
This quite a massive pull request. I wonder we should split it up into smaller ones so the nixops maintainer do not run away, when having to review this. |
If your pull request contains https://github.com/NixOS/nixops/blob/master/setup.cfg If you want to run the typecheck on your local checkout either run: $ nix-build --quiet release.nix -A build.x86_64-linux or $ nix run nixpkgs.mypy -c mypy nixops |
@Mic92 tnx for the suggestion, added |
@rbvermaa could you please review this PR |
@@ -0,0 +1 @@ | |||
fix: coretemp review -> fix typo -> change of - |
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.
remove file
hi, I'm sorry, I won't participate, just have no time @moretea , since this is basically your PR (I just added test matrix and made sure everything is working) , what do you think about rebasing your commits? |
Hello! Thank you for this PR. In the past several months, some major changes have taken place in
This is all accumulating in to what I hope will be a NixOps 2.0 My hope is that by adding types and more thorough automated testing, However, because of the major changes, it has become likely that this If you would like to see this merge, please bring it up to date with Thank you again for the work you've done here, I am sorry to be Graham |
This pr consumes:
Tests done:
libvirtd, vbox, ec2
,amazon
,gce
amazon
,gce
vbox, libvirtd
,ec2
,amazon nixops
,amazon json
,gce
vbox, libvirtd
,ec2
,amazon
,gce
vbox, libvirtd
,ec2
,amazon
,gce
vbox, libvirtd
,ec2
,amazon json
,amazon nixops
,gce
vbox
,libvirtd
,ec2
,amazon json
,amazon nixops
,gce
TODOs:
python2 tests.py tests.functional.test_cloning_clones -vv
once in 5 times throws error https://pastebin.com/fe7njGJHtests.functional.test_stopping_stops
with ec2 issue https://pastebin.com/BJwKMWti (fix 898107c). I suppose this bug occured in this test because aws returns termination responce faster if instance already stopped, just after that nixops tries to remove security group, and fails, try remove fix and you will see it youselftests.functional.test_stopping_stops
with libvirt issue https://pastebin.com/e4VLG8Cctests.functional.test_ec2_rds_dbinstance
not working tests.functional.test_ec2_rds_dbinstance not working #970python2 tests.py tests.functional.test_vpc:test_deploy_vpc -vv
no working with json state file https://pastebin.com/N8E90uke (fix e1b9158)python2 tests.py tests.functional.test_vpc:test_deploy_vpc_machine -vv
not working (https://pastebin.com/hqYBi7hF)CONSIDER (dont mind it 😄, just thoughts):
nixops.utils.attr_property
instead (also StateDict should be named ResourceStateDict, because only ResourceState can use it)isinstance(XXX, basestring)
withisinstance(XXX, six.text_type)
nixops.util.attr_property
should be wrapped inwith self.db
, maybe highlight their name likeself.state_prop_XXX
tests.functional.shared.destroy_deployments_and_remove_state_file
dont ignore'VirtualBoxState' object has no attribute 'get_backups'
error https://pastebin.com/W228z0rN