Skip to content

Commit

Permalink
Fix NPM kitchen test agent version selection (#19565)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkb7 authored and schneideradam committed Sep 22, 2023
1 parent 227689a commit fc64277
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 31 deletions.
23 changes: 10 additions & 13 deletions test/kitchen/test-definitions/windows-npm-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,30 @@

## Test matrix

The tests in this test file attempt to test all of the install/upgrade scenarios for installing the Windows agent with various install options. Starting in 7.45, the installation option changed from a Windows feature (NPM) to a more general "allow closed source".
The tests in this test file attempt to test all of the install/upgrade scenarios for installing the Windows agent with various install options. Starting in 7.45, the installation option changed from a Windows feature (NPM) to a more general "allow closed source".

For these tests, then, installing/upgrading from an "old" version means <= 7.43.
For these tests, then, installing/upgrading from an "old" version means <= 7.43.
Installing/upgrading from a "previous" version means > 7.43, but less than current version. (this is different for testing reacting
to the way the new state is recorded).
The "current" version is the version in test.


Install scenarios expected
1. Install old version with no NPM flag, install new version with closed source flag
1. Install old version with no NPM flag, install new version
- expect driver installed, system probe to enable & start
2. Install old version with no NPM flag, install new version with no flags
2. Install old version with no NPM flag, install new version
- expect driver installed, disabled
3. Install old version with NPM flag, install new version with no flags
3. Install old version with NPM flag, install new version
- expect install to detect NPM previously installed, results in system probe enabling/starting driver
4. Install new version with no closed source flag
4. Install new version with NPM disabled
- expect driver installed, disabled
5. Install new version with closed source flag
5. Install new version with NPM enabled
- expect driver installed, system probe to enable & start
6. Install previous version with closed source flag, install new version with no flag
- expect previous setting to be maintained (driver installed, system probe starts it)
7. Install version with no flag, reinstall same version with CS flag
7. Install version with no flag, reinstall same version with ADDLOCAL=ALL
- expect previous setting to be maintained (driver installed, system probe starts it)
8. Install version with ADDLOCAL=ALL
- (driver installed, system probe starts it)
9 Install version with ADDLOCAL=NPM
9. Install version with ADDLOCAL=NPM

## win-npm-upgrade-to-npm
Scenario 1
Expand All @@ -43,7 +41,6 @@ Scenario 4

## win-npm-with-cs-option
Scenario 5
- currently failing

## Scenario 6 not currently enabled

Expand All @@ -54,4 +51,4 @@ Scenario 7
Scenario 8

## win-npm-with-addlocal-npm
Scenario 9
Scenario 9
45 changes: 27 additions & 18 deletions test/kitchen/test-definitions/windows-npm-test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
suites:

# Scenario 1
# Install old version with no NPM flag, install new version with closed source flag
# - expect driver installed, system probe to enable & start
# Install old version with no NPM flag, install new version
# - expect driver installed, enable NPM, expect system probe to enable & start
- name: win-npm-upgrade-to-npm
run_list:
- "recipe[dd-agent-install]"
- "recipe[dd-agent-upgrade]"
attributes:
datadog:
agent_major_version: 7
agent_version: <%= ENV['LAST_STABLE_VERSION'] %>
agent_version: 7.42.0
api_key: <%= api_key %>
<% if ENV['AGENT_FLAVOR'] == 'datadog-iot-agent' %>
agent_flavor: 'datadog-iot-agent'
Expand All @@ -33,8 +33,6 @@ suites:
<% if ENV['WINDOWS_AGENT_FILE'] %>
windows_agent_filename: "<%= ENV['WINDOWS_AGENT_FILE'] %>"
<% end %>
agent_install_options: >
ALLOWCLOSEDSOURCE=1
dd-agent-import-conf:
api_key: <%= api_key %>
dd-agent-upgrade-rspec:
Expand All @@ -46,17 +44,17 @@ suites:



# installs the current shipping latest build
# then upgrades, and ensures that NPM not installed (due to lack of installation option)
# scenario 2
# Scenario 2
# Install old version with no NPM flag, install new version
# - expect driver installed, does not enable NPM, expect NPM installed but not running
- name: win-npm-upgrade-no-npm
run_list:
- "recipe[dd-agent-install]"
- "recipe[dd-agent-upgrade]"
attributes:
datadog:
agent_major_version: 7
agent_version: <%= ENV['LAST_STABLE_VERSION'] %>
agent_version: 7.42.0
api_key: <%= api_key %>
<% if ENV['AGENT_FLAVOR'] == 'datadog-iot-agent' %>
agent_flavor: 'datadog-iot-agent'
Expand Down Expand Up @@ -88,16 +86,16 @@ suites:


# Scenario 3
# Install old version with NPM flag, install new version with no closed source flag
# - expect driver installed, system probe to enable & start
# Install old version with NPM flag, install new version
# - expect driver installed, enable NPM, expect system probe to enable & start
- name: win-npm-upgrade-to-npm-no-csflag
run_list:
- "recipe[dd-agent-install]"
- "recipe[dd-agent-upgrade]"
attributes:
datadog:
agent_major_version: 7
agent_version: <%= ENV['LAST_STABLE_VERSION'] %>
agent_version: 7.42.0
api_key: <%= api_key %>
<% if ENV['AGENT_FLAVOR'] == 'datadog-iot-agent' %>
agent_flavor: 'datadog-iot-agent'
Expand Down Expand Up @@ -132,6 +130,8 @@ suites:


# Scenario 4
# Install latest
# - expect driver installed, does not enable NPM, expect NPM installed but not running
- name: win-npm-no-npm-option
run_list:
- "recipe[dd-agent-install]"
Expand All @@ -156,7 +156,9 @@ suites:
agent_flavor: <%= ENV['AGENT_FLAVOR'] || "datadog-agent" %>
skip_windows_signing_test: &skip_windows_signing_test <%= ENV['SKIP_SIGNATURE_TEST'] || false %>

#Scenario 5
# Scenario 5
# Install latest
# - expect driver installed, enable NPM, expect system probe to enable & start
- name: win-npm-with-cs-option
run_list:
- "recipe[dd-agent-install]"
Expand All @@ -176,14 +178,14 @@ suites:
<% if ENV['WINDOWS_AGENT_FILE'] %>
windows_agent_filename: "<%= ENV['WINDOWS_AGENT_FILE'] %>"
<% end %>
agent_install_options: >
ALLOWCLOSEDSOURCE=1
enable_testsigning: <%= ENV['WINDOWS_DDNPM_DRIVER'] == "testsigned" %>
dd-agent-rspec:
agent_flavor: <%= ENV['AGENT_FLAVOR'] || "datadog-agent" %>
skip_windows_signing_test: &skip_windows_signing_test <%= ENV['SKIP_SIGNATURE_TEST'] || false %>

# scenario 7
# Scenario 7
# Install latest, reinstall latest with ADDLOCAL=ALL to test old option compat
# - expect driver installed, enable NPM, expect system probe to enable & start
- name: win-npm-reinstall-option
run_list:
- "recipe[dd-agent-install]"
Expand Down Expand Up @@ -219,7 +221,9 @@ suites:
agent_flavor: <%= ENV['AGENT_FLAVOR'] || "datadog-agent" %>
skip_windows_signing_test: &skip_windows_signing_test <%= ENV['SKIP_SIGNATURE_TEST'] || false %>

#Scenario 8
# Scenario 8
# Install latest with ADDLOCAL=ALL to test old option compat
# - expect driver installed, enable NPM, expect system probe to enable & start
- name: win-npm-with-addlocal-all
run_list:
- "recipe[dd-agent-install]"
Expand Down Expand Up @@ -247,7 +251,9 @@ suites:
skip_windows_signing_test: &skip_windows_signing_test <%= ENV['SKIP_SIGNATURE_TEST'] || false %>


#Scenario 9
# Scenario 9
# Install latest with ADDLOCAL=NPM to test old option compat
# - expect driver installed, enable NPM, expect system probe to enable & start
- name: win-npm-with-addlocal-npm
run_list:
- "recipe[dd-agent-install]"
Expand All @@ -274,6 +280,9 @@ suites:
agent_flavor: <%= ENV['AGENT_FLAVOR'] || "datadog-agent" %>
skip_windows_signing_test: &skip_windows_signing_test <%= ENV['SKIP_SIGNATURE_TEST'] || false %>

# Scenario 10
# Install original NPM beta version, upgrade to latest
# - expect driver installed, enable NPM, expect system probe to enable & start
- name: win-npm-beta-upgrade
run_list:
- "recipe[dd-agent-install]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
it_behaves_like 'an installed Agent'
it_behaves_like 'a running Agent with no errors'
it_behaves_like 'a Windows Agent with NPM driver installed'
it_behaves_like 'a Windows Agent with NPM running'
it_behaves_like 'an upgraded Agent with the expected version'
end

0 comments on commit fc64277

Please sign in to comment.