-
Notifications
You must be signed in to change notification settings - Fork 226
Fixes #38909 - Use syslog gem not in windows #927
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
base: develop
Are you sure you want to change the base?
Conversation
ekohl
left a comment
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.
Could you open a Redmine issue for this?
I'd also love to have some CI on GHA that uses a Windows runner to test if it works, but lack the specific knowledge (and time). Do you have any idea how hard that would be?
9475601 to
26d48a1
Compare
1b37d01 to
6f459ce
Compare
6f459ce to
a26d0a0
Compare
a26d0a0 to
e0489fb
Compare
0acc281 to
cf25385
Compare
|
@sbernhard Please create a Redmine issue & have a look at the failing tests. Please ping Ewoud after GHA are 🍏 for a final ACK. edit: apologies; Redmine issue is open but GHA still fails. There must be another reason for that. |
everything done. |
|
@sbernhard the Redmine check is still failing: the commit must reference the issue. |
cf25385 to
0c16aa9
Compare
|
Fixed it. Thanks @ekohl |
ekohl
left a comment
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.
Looking at ruby/syslog@ffbfaa6 I wonder if it's really needed. I'd expect the gem (>= 0.2.0) to install on Windows and be a noop.
2e45ba6 to
ea54111
Compare
2aff80f to
91d8af2
Compare
91d8af2 to
40457c9
Compare
ekohl
left a comment
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.
By now this really evolved into just testing on Windows, which is still a good thing. Do you have any idea what is needed to actually make the tests work?
I think this (and the krb5) related tests should be skipped. The modules themselves (both The biggest risk I see is that we silently disable the tests without knowing it, but I'm sure we can find a way around that. |
I don't know how to skip the tests for these plugins. Can you please let me know more what you mean regarding |
In normal operation the Smart Proxy loads things in some order:
The main file is interesting because it loads all the plugins that are built in, but there's also the smart_proxy_for_testing which does NOT do that. I'll admit the exact details here are not entirely clear to me since it's been a while. I think for plugins from gems we rely on Bundler to include them, but load order is a bit vague. However, those plugins are only the plugin definitions. Taking DNS as an example: dns/dns only loads dns/configuration_loader and dns/dns_plugin. Zooming in on It's in the Proxy::PluginInitializer that actually really initializes the plugin. This is not a trivial class because it uses dependency injection, but I still think it makes a lot of sense. It's initialize_plugins that does a bunch of steps that eventually calls load_classes. It allows for loading plugin definitions but having the plugin itself disabled via configuration. This is more efficient (less memory used) but can also help if the actual implementation is unavailable (like Kerberos or libvirt bindings that aren't installed. But in the end this is all what runtime does. Testing is different: it loads many things unconditionally. Taking the failing libvirt test: the test library loads
At runtime this class is only loaded if it's really needed: smart-proxy/modules/dhcp_libvirt/configuration_loader.rb Lines 24 to 25 in 867f19e
That part is really loading the libvirt bindings: smart-proxy/modules/dhcp_libvirt/libvirt_dhcp_network.rb Lines 1 to 2 in 867f19e
This is all a long intro into the loading mechanism. The real challenge is to modify the test suite so that it:
I don't have a good answer on that right now. My had a thought about looking at which bundler groups were available. I couldn't find a good API for that, but didn't dig very deep. You can probably be blunt and use: begin
Bundler.require(:libvirt)
rescue LoadError # or whatever it throws
LIBVIRT_BUNDLER_GROUP_AVAILABLE = false
else
LIBVIRT_BUNDLER_GROUP_AVAILABLE = true
require 'dhcp_libvirt/libvirt_dhcp_network'
endThen based on https://test-unit.github.io/test-unit/en/Test/Unit/TestCaseOmissionSupport.html I'd try enhancing each def test_dump_xml
omit_unless(LIBVIRT_BUNDLER_GROUP_AVAILABLE) do
a_xml = '<xml></xml>'
@network.expects(:xml_desc).returns(a_xml)
assert_equal a_xml, @subject.dump_xml
end
endAnd perhaps there's a nicer way. https://test-unit.github.io/test-unit/en/Test/Unit/TestCase.html may be helpful in seeing if that's an option. Looking at that particular class LibvirtDHCPNetworkTest < Test::Unit::TestCase
def setup
omit_unless(LIBVIRT_BUNDLER_GROUP_AVAILABLE)
# rest of the existing code here
end
endPerhaps I'm also thinking too complex and perhaps Test::Unit already has something built in. |
No description provided.