Skip to content
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

Add a small quality-of-life change for tests #1147

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

deriamis
Copy link

Description

In the Project and Library specs, we use an expect construct to ensure the build order is consistent. However, when there is a failure, we see a diff of the internal object representations. We can map the :name property into the construct instead to get a diff of the component names.


Maintainers

Please ensure that you check for:

  • If this change impacts git cache validity, it bumps the git cache
    serial number
  • If this change impacts compatibility with omnibus-software, the
    corresponding change is reviewed and there is a release plan
  • If this change impacts compatibility with the omnibus cookbook, the
    corresponding change is reviewed and there is a release plan

@deriamis deriamis requested review from a team as code owners February 29, 2024 00:06
In the Project and Library specs, we use an `expect` construct to
ensure the build order is consistent. However, when there is a
failure, we see a diff of the internal object representations.
We can map the `:name` property into the construct instead to get
a diff of the component names.

Signed-off-by: Ryan Egesdahl <[email protected]>
@@ -113,7 +113,7 @@ def generate_software(name, version, dependencies = [])
end

it "returns an array of software descriptions, with all top level deps first, assuming they are not themselves transitive deps" do
expect(library.build_order).to eql(
expect(library.build_order(&:name)).to eql(
Copy link
Contributor

Choose a reason for hiding this comment

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

@deriamis should that be build_order.map(&:name) again, or am I missing something?

Copy link
Author

Choose a reason for hiding this comment

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

No, you aren't missing anything. I am 🤡.

This is something I was moving over from something else I was doing, and I couldn't just cherry-pick it because it was part of something larger. Looks like I missed a couple of details. I'll push up a fix.

Signed-off-by: Ryan Egesdahl <[email protected]>
Copy link

sonarcloud bot commented Feb 29, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants