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

CI: Re-enable Windows for testing #31

Merged
merged 10 commits into from
Aug 20, 2024
Merged

CI: Re-enable Windows for testing #31

merged 10 commits into from
Aug 20, 2024

Conversation

SchoolGuy
Copy link
Member

@SchoolGuy SchoolGuy commented Jul 22, 2024

Fixes #2

The scope of this PR was expanded due to details that appeared during the actual bugfix. This PR now contains changes for the following things:

  • CI: Enable Windows for testing
  • CI: Only send coverage to Codacy when running on Linux
  • Tests: Replace https://github.com/ContainerSolutions/go-utils with our own code
  • Tests: Add support for multi-buffered requests and responses
  • Items: enable_gpxe was renamed to enable_ipxe
  • Client: Add helper method IsValueInherit
  • Tests: Remove mock system creation and use the real method

The code in this PR was not validated against a running Cobbler instance.

@SchoolGuy SchoolGuy added this to the 0.5.0 milestone Jul 22, 2024

This comment was marked as duplicate.

@SchoolGuy
Copy link
Member Author

It appears that we are running into golang/go#51269

@SchoolGuy
Copy link
Member Author

After a bit of investigation, it appears that we are using the StubHTTPClient which is coming from http://github.com/ContainerSolutions/go-utils. This is a problem as the comparison that lets the Windows CI fail is done in that package.

@SchoolGuy
Copy link
Member Author

I will extend the scope of this PR to also remove go-utils from the dependencies of the project so we can have our own implementation of an HTTPClient. This allows us then to use buffered responses for multiple requests and responses per-test.

@SchoolGuy
Copy link
Member Author

Working on this PR showed that the creation of objects is not possible since we are using the embedded item structs due to the method updateCobblerFields not being able to handle that.

@SchoolGuy
Copy link
Member Author

Okay Windows likes use now. Let's get back to fixing the skipped tests.

This comment was marked as duplicate.

Copy link

codacy-production bot commented Aug 17, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+4.20% (target: -1.00%) 66.99%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (caa2583) 2111 993 47.04%
Head commit (0ff47d4) 2258 (+147) 1157 (+164) 51.24% (+4.20%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#31) 103 69 66.99%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@SchoolGuy SchoolGuy requested a review from a team August 19, 2024 11:01
Copy link
Contributor

@tiltingpenguin tiltingpenguin left a comment

Choose a reason for hiding this comment

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

I just have some minor things I want to clarify, otherwise LGTM. One general comment I want to make though is that the DeleteItemRecursive tests seem kind of useless to me since we only test them in the false case where the behaviour is the same as in the non recurisve function

authentication_test.go Outdated Show resolved Hide resolved
cobblerclient.go Show resolved Hide resolved
SchoolGuy and others added 4 commits August 20, 2024 14:29
This change was done server side with 3.3.0.
This is a helper method that doesn't perform an XML-RPC call which verifies if a given interface is the magic "<<inherit>>" or not.
This commit also fixes the Windows test issues and fixes the implementation of "updateCobblerFields" to make the test pass.
@SchoolGuy SchoolGuy merged commit 729746b into main Aug 20, 2024
18 checks passed
@SchoolGuy SchoolGuy deleted the ci/enable-windows branch August 20, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

CI fails on Windows
2 participants