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

Reorganize the specs for some kitchen test #15027

Merged
merged 3 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions test/kitchen/test/integration/common/rspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,24 @@ def is_dpkg_package_installed(package)
end

shared_examples_for "a running Agent with APM" do
if os == :windows
it 'has the apm agent running' do
expect(is_process_running?("trace-agent.exe")).to be_truthy
expect(is_service_running?("datadog-trace-agent")).to be_truthy
end
end
it 'is bound to the port that receives traces by default' do
expect(is_port_bound(8126)).to be_truthy
end
end

shared_examples_for "a running Agent with process enabled" do
it 'has the process agent running' do
expect(is_process_running?("process-agent.exe")).to be_truthy
expect(is_service_running?("datadog-process-agent")).to be_truthy
end
end

shared_examples_for "a running Agent with APM manually disabled" do
it 'is not bound to the port that receives traces when apm_enabled is set to false' do
conf_path = ""
Expand Down Expand Up @@ -845,11 +858,6 @@ def is_dpkg_package_installed(package)
expect(confYaml).to have_key("apm_config")
expect(confYaml["apm_config"]).to have_key("enabled")
expect(confYaml["apm_config"]["enabled"]).to be_truthy
expect(is_port_bound(8126)).to be_truthy
end
it 'has the apm agent running' do
expect(is_process_running?("trace-agent.exe")).to be_truthy
expect(is_service_running?("datadog-trace-agent")).to be_truthy
end
end

Expand All @@ -870,10 +878,6 @@ def is_dpkg_package_installed(package)
expect(confYaml["process_config"]["process_collection"]).to have_key("enabled")
expect(confYaml["process_config"]["process_collection"]["enabled"]).to be_truthy
end
it 'has the process agent running' do
expect(is_process_running?("process-agent.exe")).to be_truthy
expect(is_service_running?("datadog-process-agent")).to be_truthy
end
end

shared_examples_for 'an upgraded Agent with the expected version' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

describe 'win-all-subservices' do
it_behaves_like 'an installed Agent'
it_behaves_like 'a running Agent with no errors'
it_behaves_like 'an Agent with APM enabled'
it_behaves_like 'an Agent with logs enabled'
it_behaves_like 'an Agent with process enabled'
it_behaves_like 'a running Agent with no errors'
it_behaves_like 'a running Agent with APM'
it_behaves_like 'a running Agent with process enabled'
end

Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@
end
describe 'dd-agent-win-user' do
# it_behaves_like 'an installed Agent'
it_behaves_like 'a running Agent with no errors'
it_behaves_like 'an Agent with APM enabled'
it_behaves_like 'an Agent with process enabled'
it_behaves_like 'an Agent with valid permissions'
it_behaves_like 'a running Agent with no errors'
it_behaves_like 'a running Agent with APM'
it_behaves_like 'a running Agent with process enabled'
end