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

fix(agent-control): rename Super Agent to Agent Control in chef-install #25

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
4 changes: 2 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
# logs-integration
# php-agent-installer
# dotnet-agent-installer
# super-agent
# logs-integration-super-agent
# agent-control
# logs-integration-agent-control
default['newrelic_install']['targets'] = []

########
Expand Down
4 changes: 2 additions & 2 deletions resources/newrelic_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def check_targets
logs-integration
php-agent-installer
dotnet-agent-installer
super-agent
logs-integration-super-agent
agent-control
logs-integration-agent-control
))
allowed_targets_string = allowed_targets.join(', ')
incoming_targets = new_resource.targets.to_set
Expand Down
32 changes: 16 additions & 16 deletions spec/unit/resources/newrelic_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,37 +231,37 @@
end
end

context 'when targets only contains super agent' do
context 'when targets only contains agent control' do
default_attributes['newrelic_install']['NEW_RELIC_API_KEY'] = 'xxx'
default_attributes['newrelic_install']['NEW_RELIC_ACCOUNT_ID'] = 'xxx'
default_attributes['newrelic_install']['NEW_RELIC_REGION'] = 'xxx'
default_attributes['newrelic_install']['targets'] = ['super-agent']
default_attributes['newrelic_install']['targets'] = ['agent-control']

it 'should execute with target infra and skip core' do
expect(subject).to run_execute('newrelic install').with(env: have_key('NEW_RELIC_CLI_SKIP_CORE'))
end

it 'run bash newrelic install command with super-agent' do
expect(subject).to run_execute('newrelic install').with(command: include('super-agent'))
it 'run bash newrelic install command with agent-control' do
expect(subject).to run_execute('newrelic install').with(command: include('agent-control'))
end

it 'run powershell newrelic install command without super-agent' do
expect(subject).not_to run_powershell_script('newrelic install').with(code: include('super-agent'))
it 'run powershell newrelic install command without agent-control' do
expect(subject).not_to run_powershell_script('newrelic install').with(code: include('agent-control'))
end
end

context 'when targets contains super agent infra agent and logs' do
context 'when targets contains agent control infra agent and logs' do
default_attributes['newrelic_install']['NEW_RELIC_API_KEY'] = 'xxx'
default_attributes['newrelic_install']['NEW_RELIC_ACCOUNT_ID'] = 'xxx'
default_attributes['newrelic_install']['NEW_RELIC_REGION'] = 'xxx'
default_attributes['newrelic_install']['targets'] = %w(super-agent infrastructure-agent-installer logs-integration)
default_attributes['newrelic_install']['targets'] = %w(agent-control infrastructure-agent-installer logs-integration)

it 'should execute with target infra and skip core' do
expect(subject).to run_execute('newrelic install').with(env: have_key('NEW_RELIC_CLI_SKIP_CORE'))
end

it 'run bash newrelic install command with super-agent' do
expect(subject).to run_execute('newrelic install').with(command: include('super-agent'))
it 'run bash newrelic install command with agent-control' do
expect(subject).to run_execute('newrelic install').with(command: include('agent-control'))
end

it 'run bash newrelic install command with infra' do
Expand All @@ -272,22 +272,22 @@
expect(subject).to run_execute('newrelic install').with(command: include('logs-integration'))
end
end
context 'when targets only contains super agent logs' do
context 'when targets only contains agent control logs' do
default_attributes['newrelic_install']['NEW_RELIC_API_KEY'] = 'xxx'
default_attributes['newrelic_install']['NEW_RELIC_ACCOUNT_ID'] = 'xxx'
default_attributes['newrelic_install']['NEW_RELIC_REGION'] = 'xxx'
default_attributes['newrelic_install']['targets'] = ['logs-integration-super-agent']
default_attributes['newrelic_install']['targets'] = ['logs-integration-agent-control']

it 'should execute with target infra and skip core' do
expect(subject).to run_execute('newrelic install').with(env: have_key('NEW_RELIC_CLI_SKIP_CORE'))
end

it 'run bash newrelic install command with logs-integration-super-agent' do
expect(subject).to run_execute('newrelic install').with(command: include('logs-integration-super-agent'))
it 'run bash newrelic install command with logs-integration-agent-control' do
expect(subject).to run_execute('newrelic install').with(command: include('logs-integration-agent-control'))
end

it 'run powershell newrelic install command without logs-integration-super-agent' do
expect(subject).not_to run_powershell_script('newrelic install').with(code: include('logs-integration-super-agent'))
it 'run powershell newrelic install command without logs-integration-agent-control' do
expect(subject).not_to run_powershell_script('newrelic install').with(code: include('logs-integration-agent-control'))
end
end
end
Loading