Skip to content

[OC-4668] add functional tests for deploy_revision#468

Closed
danielsdeleo wants to merge 5 commits into
masterfrom
OC-4668
Closed

[OC-4668] add functional tests for deploy_revision#468
danielsdeleo wants to merge 5 commits into
masterfrom
OC-4668

Conversation

@danielsdeleo

Copy link
Copy Markdown
Contributor

Functional tests for deploy_revision.

Exercises :deploy and :force_deploy for first deploy w/ or w/o existing directory structure, redeploy at same version, force deploy at the same version, and redeploy to an old version ("implicit rollback").

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be worth commenting why you're expecting this result in restart.txt.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think making the content here "callback_order.inspect" suggests to the reader that it's special somehow. Why not just make it "example after restart", so it's clear that it's not important, nor will it be tested later, that it's related to callback order?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment that the value isn't checked seems worthwhile. The nice thing about doing this is that you'll get diff output when you run the tests:

Cloning into '/var/folders/c5/_9tvqbxd5730d8pjq9cmnnyh0000gq/T/d20121102-31924-12824kr/shared/cached-copy'...
--- /var/folders/c5/_9tvqbxd5730d8pjq9cmnnyh0000gq/T/chef-tempfile20121102-31924-an4sn7 2012-11-02 13:34:46.000000000 -0700
+++ /var/folders/c5/_9tvqbxd5730d8pjq9cmnnyh0000gq/T/chef-diff20121102-31924-dm4cim 2012-11-02 13:34:46.000000000 -0700
@@ -0,0 +1 @@
+[:before_migrate]
\ No newline at end of file
--- /var/folders/c5/_9tvqbxd5730d8pjq9cmnnyh0000gq/T/chef-tempfile20121102-31924-hnk770 2012-11-02 13:34:46.000000000 -0700
+++ /var/folders/c5/_9tvqbxd5730d8pjq9cmnnyh0000gq/T/chef-diff20121102-31924-1xvxk2e    2012-11-02 13:34:46.000000000 -0700
@@ -0,0 +1 @@
+[:before_migrate, :before_symlink]
\ No newline at end of file
--- /var/folders/c5/_9tvqbxd5730d8pjq9cmnnyh0000gq/T/chef-tempfile20121102-31924-1kn3lea    2012-11-02 13:34:46.000000000 -0700
+++ /var/folders/c5/_9tvqbxd5730d8pjq9cmnnyh0000gq/T/chef-diff20121102-31924-ra1wle 2012-11-02 13:34:46.000000000 -0700
@@ -0,0 +1 @@
+[:before_migrate, :before_symlink, :before_restart]
\ No newline at end of file
--- /var/folders/c5/_9tvqbxd5730d8pjq9cmnnyh0000gq/T/chef-tempfile20121102-31924-16fk0bj    2012-11-02 13:34:46.000000000 -0700
+++ /var/folders/c5/_9tvqbxd5730d8pjq9cmnnyh0000gq/T/chef-diff20121102-31924-xybfwq 2012-11-02 13:34:46.000000000 -0700
@@ -0,0 +1 @@
+[:before_migrate, :before_symlink, :before_restart, :after_restart]
\ No newline at end of file

In the case that a code change breaks the order, you would get a hint about what's going on by looking at this.

@btm

btm commented Nov 5, 2012

Copy link
Copy Markdown
Contributor

* Use a single file to track order of operations between different steps
  in the tests
* Use symbolic names when tracking order of operations so it's more
  human readable
* Mark tests as unix_only, deploy doesn't support windows
* Add tests that run a "migration"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a little odd just sitting out here in the wind. Move to before block, and @ohai ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a hack so ohai only runs once. before(:all) might work.

@danielsdeleo

Copy link
Copy Markdown
Contributor Author

Merged this, dunno why github didn't pick it up. @timh, all of your comments were addressed in final commit.

@sethvargo sethvargo deleted the OC-4668 branch July 3, 2013 03:43
ksubrama pushed a commit that referenced this pull request Sep 30, 2015
Revert version pins in chef-dk.
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants