-
Notifications
You must be signed in to change notification settings - Fork 252
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
[sed] Bats tests for sed #2401
[sed] Bats tests for sed #2401
Conversation
fc5a85c
to
c1de530
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.
c1de530
to
b450da5
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.
Excellent work @james-stocks. 👍
While these changes are approved, we don't yet have a process for merging commits to base plans outside of a base plan refresh - so we can't immediately merge this. |
Signed-off-by: Scott Macfarlane <smacfarlane@chef.io>
@james-stocks Would you mind giving this a quick touch-up to meet the testing guidelines? I know you started this before those were in place, so if you don't have the cycles, I'm good with merging this to the refresh branch and adjusting the tests down the road. |
[gradle4][gradle5]Fix builds of gradle4 and gradle5
Signed-off-by: Graham Weldon <graham@grahamweldon.com>
…form-0.12.3 [terraform] Update terraform to 0.12.3
* for windows and linux * with amendments according to according to comments in issue habitat-sh#2678 Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
…en/7zip_use_core_pester [7zip] Update windows tests to use new core/pester core plan
* bringing structure inline with [test design document](habitat-sh#2539) * using core/pester Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
…en/fix_dotnet_471_pkg_source_v2 [dotnet-471-dev-pack] VERSION 2: Add Pester tests to habitat installation of dotnet-471-dev-pack
sed/plan.sh
Outdated
@@ -1,4 +1,4 @@ | |||
pkg_name=sed | |||
pkg_name="sed" |
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 don't need quotes here.
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 fails shellcheck in CI when I remove the quotes
In sed/plan.sh line 1:
--
| pkg_name=sed
| ^-- SC2209: Use var=$(command) to assign output (or quote to assign string).
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 believe this is because sed
is commonly identified as a command that someone is attempting to run. We should add a shellcheck exception for this plan, on this line.
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.
What's the issue with having the quotes?
git grep pkg_name=\" | wc -l
tells me there are ~95 core plans with quoted pkg_name values; and I'm wondering if I need to address them all at some point - I can file an issue for that and get them updated, but I'd like to track the reason why it's needed.
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 changed to a shellcheck disable comment, but I'm still curious why we don't use quotes to avoid the concern than shellcheck highlights.
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.
Its a false negative in this case. shellcheck thinks you're calling the sed command. There shouldn't be any need to quote a plan name.
@@ -0,0 +1,19 @@ | |||
#!/bin/sh |
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.sh
is out of date. We should update this to be more in line with the new testing approach/standard that we have adopted. See examples in plans such as: hugo, terraform, nginx, hapropxy etc. The same applies for the sourceing in test.bats
, which is no longer needed when using the new approach.
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.sh
seems to meet the current testing standard and I don't see any sourcing in test.bats
Does this comment refer an older revision of this PR (it did previously have an initial attempt that predated the standard being decided), or am I missing something?
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.
Ah yes I did change the tests a day after this comment was left. I think the line that @predominant commented on remained unchanged, so Github doesn't consider this comment outdated.
22931a8
to
9c70c0c
Compare
Signed-off-by: James Stocks <jstocks@chef.io>
When pkg_name is unquoted like `pkg_name=sed` this causes a shellcheck warning in CI: ``` In sed/plan.sh line 1: pkg_name=sed ^-- SC2209: Use var=$(command) to assign output (or quote to assign string). ``` We don't want quotes here, so instead disable the shellcheck. Signed-off-by: James Stocks <jstocks@chef.io>
08be889
to
18a76f5
Compare
@smacfarlane do you want these changes pointed at |
@james-stocks Yes, please. Let's incorporate this into the refresh. |
Closing - opened new PR #2755 that points at the refresh branch. |
Context
Supersedes #2368
Based on @predominant's work in https://github.com/habitat-sh/core-plans/pull/2377/files but I changed the tests slightly to add assurance that the version of
sed
that is being executed is the last built sed and not a different package's sed or even the system sed.Signed-off-by: James Stocks jstocks@chef.io