-
Notifications
You must be signed in to change notification settings - Fork 112
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
Transplant verify functionality from chef-cli #479
Conversation
891992d
to
dbb3f31
Compare
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 would like to talk about this PR. A general question would be
"What happens when a user tries to run chef verify
?"
Are we deprecating this command? or just remove it for good without notice?
It was hidden internal command which wasn't provided for use to customers, so I'm planning to remove it without deprecation |
7b8b436
to
55edea5
Compare
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.
Lots of code, it will take me a few to review this.
Do we need this file though?
omnibus/verification/spec/unit/fixtures/eg_omnibus_dir/valid/embedded/apps/chef-dk/.keep
Also it is hard to see what is copy paste code and what are the things you have modified, like commenting out code, etc.
ae96cd6
to
f1395af
Compare
@afiune here's a diff of verify and component_test: https://gist.github.com/marcparadise/3c7470aee219a0c9ae847ac98928e223 |
.expeditor/verify.pipeline.yml
Outdated
@@ -8,6 +8,15 @@ steps: | |||
executor: | |||
docker: | |||
image: ruby:2.6-stretch | |||
- label: verification-unit-tests-ruby-2.6 |
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.
We should just call this component-tests. They're not unit tests really for a lot of things.
8f9e1cc
to
05998a4
Compare
@marcparadise I just looked at the buildkite job output and I see the following:
Wondering if thats the expected output and if the |
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.
@marcparadise Salim and I added some commits to help us understand what is going on here.
It looks to me like you wrote some scripts (run.rb
, verify.rb
, component_test.rb
) that contain logic for how to test components included inside Chef Workstation. LGTM, 👍
The spec
folder initially confused me until I realized those are the tests for the logic in verify.rb
and other scripts. I added a short README to help my future brain remember.
With that understanding this looks 🚀 🍰 to me!
d7f2e23
to
df7f105
Compare
This moves the verify command into chef-workstation, since it is only used to verify the builds in the omnibus pipeline. This removes the indirect circular dependency between Workstation and CLI as well, since CLI no longer needs to know about what tools ship with Workstation. This is a minimally modified transplant of the Verify class and the supporting class ComponentTest from chef-cli. Once all is well, we can update chef-cli to remove the verify command. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
This allows us to keep `verify.rb` containing only the verification class definition, which prevents us from actually running verification when attempting to run unit specs. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Moved inlined ruby into a separate script for readability. Removed chef-run because it's tested in verify itself. Removed a second `chef env` run because one verifies just as well as two in this case. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Because moving `verify` into Workstation doesn't alter which tests we do/do not run, we will address these separately. We'll be tracking the state of verification tests under #487. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Running CI again. The secondary issues we've been having lately have been bubbling through to these builds, but it looks like current master is sane. |
Thanks for adding the README, I meant to include that when I made that directory - figured it would otherwise be weird -- "Why are these specs in a random omnibus directory..." |
Signed-off-by: tyler-ball <tball@chef.io>
We've seen issues where "exit" does not properly set the system exit code but "exit!" does. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
@@ -3,6 +3,9 @@ source "https://rubygems.org" | |||
group :development do | |||
gem "chefstyle" | |||
gem "rake" | |||
# enable tests for the verification behavior in omnibus/verification | |||
gem "chef-cli" | |||
gem "rspec" |
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.
If unit is disabled do we still need rspec?
89fe850
to
d5d5c8a
Compare
Return to the original state of Workstation where we did not run unit tests in verification. There are a couple of problems with unit tests currently that need to be addressed before we enable them: - they must be run as root because we bundle install in the gem's chef-workstation-ruby source lib directory - windows unit tests are failing. We don't currently know yet if are legitimate failures, but we do know that we've been shipping without runnign those tests for a while now. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
This moves the
verify
command into chef-workstation, since it is only used to verify the builds in the omnibus pipeline. This helps reduce the indirect circular dependency between Workstation and CLI as well, since CLI no longer needs to know about what tools ship with Workstation.This is minimally modified transplant of the
Verify
class and the supporting classComponentTest
. Once all is well, we can updatechef-cli
to remove theverify
command.Signed-off-by: Marc A. Paradise marc.paradise@gmail.com
Related Issue
Types of changes
Checklist: