Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
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
8 changes: 4 additions & 4 deletions .ci/.e2e-tests-for-elastic-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ SUITES:
platforms:
- labels: "arm64"
- labels: "ubuntu-18.04"
provider: "elastic-package"
provider: "docker"
scenarios:
- name: "Fleet"
pullRequestFilter: " && ~debian"
tags: "fleet_mode_agent"
platforms:
- labels: "ubuntu-18.04"
provider: "elastic-package"
provider: "docker"
- name: "Integrations"
pullRequestFilter: " && ~debian"
tags: "integrations"
Expand All @@ -27,13 +27,13 @@ SUITES:
- name: "System Integration"
platforms:
- labels: "ubuntu-18.04"
provider: "elastic-package"
provider: "docker"
pullRequestFilter: " && ~debian"
tags: "system_integration"
- name: "Stand-alone"
platforms:
- labels: "ubuntu-18.04"
provider: "elastic-package"
provider: "docker"
pullRequestFilter: " && ~ubi8"
tags: "stand_alone_agent"
- name: "Backend Processes"
Expand Down
10 changes: 5 additions & 5 deletions .ci/.e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ SUITES:
platforms:
- labels: "arm64"
- labels: "ubuntu-18.04"
provider: "elastic-package"
provider: "docker"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have simply removed the provider line for each occurrence, but I preferred to have them explicitly here for a possible rollback in the short/medium term

scenarios:
- name: "Fleet"
pullRequestFilter: " && ~debian"
tags: "fleet_mode_agent"
platforms:
- labels: "ubuntu-18.04"
provider: "elastic-package"
provider: "docker"
- labels: "windows-2019"
provider: "elastic-package"
provider: "docker"
- name: "Integrations"
pullRequestFilter: " && ~debian"
tags: "integrations"
Expand All @@ -42,13 +42,13 @@ SUITES:
- name: "System Integration"
platforms:
- labels: "ubuntu-18.04"
provider: "elastic-package"
provider: "docker"
pullRequestFilter: " && ~debian"
tags: "system_integration"
- name: "Stand-alone"
platforms:
- labels: "ubuntu-18.04"
provider: "elastic-package"
provider: "docker"
pullRequestFilter: " && ~ubi8"
tags: "stand_alone_agent"
- name: "Backend Processes"
Expand Down
48 changes: 48 additions & 0 deletions internal/deploy/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,54 @@ import (
"github.com/stretchr/testify/assert"
)

func Test_New(t *testing.T) {
t.Run("New Docker Provider", func(t *testing.T) {
provider := New("docker")

s, ok := provider.(Deployment)
assert.True(t, ok, "Provider is not a Deployment")

s, ok = s.(*dockerDeploymentManifest)
assert.True(t, ok, "Provider is not Docker")
})

t.Run("New Elastic Package Provider", func(t *testing.T) {
provider := New("elastic-package")

s, ok := provider.(Deployment)
assert.True(t, ok, "Provider is not a Deployment")

s, ok = s.(*EPServiceManager)
assert.True(t, ok, "Provider is not Elastic Package")
})

t.Run("New K8S Provider", func(t *testing.T) {
provider := New("kubernetes")

s, ok := provider.(Deployment)
assert.True(t, ok, "Provider is not a Deployment")

s, ok = s.(*kubernetesDeploymentManifest)
assert.True(t, ok, "Provider is not Kubernetes")
})

t.Run("New Remote Provider", func(t *testing.T) {
provider := New("remote")

s, ok := provider.(Deployment)
assert.True(t, ok, "Provider is not a Deployment")

s, ok = s.(*remoteDeploymentManifest)
assert.True(t, ok, "Provider is not Remote")
})

t.Run("New Not Found Provider", func(t *testing.T) {
provider := New("asdf")

assert.Nil(t, provider, "Provider is not Nil")
})
}

func Test_ServiceRequest_GetName(t *testing.T) {
t.Run("ServiceRequest without flavour", func(t *testing.T) {
srv := NewServiceRequest("foo")
Expand Down