Skip to content

Commit

Permalink
chore(agent-control): rename Super Agent to Agent Control
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenruizdegauna committed Dec 17, 2024
1 parent 31ad7c7 commit 08570e5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
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

0 comments on commit 08570e5

Please sign in to comment.