Skip to content

Commit acb7cf9

Browse files
fix: resolve conflicts
1 parent c44fe66 commit acb7cf9

File tree

4 files changed

+12
-546
lines changed

4 files changed

+12
-546
lines changed

.buildkite/scripts/buildkite-integration-tests.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,11 @@ outputXML="build/${fully_qualified_group_name}.integration.xml"
4949
outputJSON="build/${fully_qualified_group_name}.integration.out.json"
5050

5151
echo "~~~ Integration tests: ${GROUP_NAME}"
52-
<<<<<<< HEAD
53-
GOTEST_ARGS=(-tags integration -test.shuffle on -test.timeout 2h0m0s)
54-
if [ -n "$TEST_NAME_PATTERN" ]; then
55-
GOTEST_ARGS+=(-run="${TEST_NAME_PATTERN}")
56-
fi
57-
GOTEST_ARGS+=("github.com/elastic/elastic-agent/testing/integration" -v -args "-integration.groups=${GROUP_NAME}" "-integration.sudo=${TEST_SUDO}")
58-
59-
=======
6052
# -test.timeout=2h0m0s is set because some tests normally take up to 45 minutes.
6153
# This 2-hour timeout provides enough room for future, potentially longer tests,
6254
# while still enforcing a reasonable upper limit on total execution time.
6355
# See: https://pkg.go.dev/cmd/go#hdr-Testing_flags
6456
GOTEST_ARGS=(-tags integration -test.shuffle on -test.timeout 2h0m0s "${TEST_PACKAGE}" -v -args "-integration.groups=${GROUP_NAME}" "-integration.sudo=${TEST_SUDO}" "-integration.fips=${FIPS:-false}")
65-
>>>>>>> 92e139ca2 ([tests] split up serverless and resource leaks integration tests (#8396))
6657
set +e
6758
TEST_BINARY_NAME="elastic-agent" AGENT_VERSION="${AGENT_VERSION}" SNAPSHOT=true \
6859
gotestsum --no-color -f standard-quiet --junitfile "${outputXML}" --jsonfile "${outputJSON}" -- "${GOTEST_ARGS[@]}"

testing/integration/fleetserver_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,9 @@ func TestInstallFleetServerBootstrap(t *testing.T) {
6969
policyResp, err := info.KibanaClient.CreatePolicy(ctx, fleetPolicy())
7070
require.NoError(t, err, "failed creating policy")
7171
policy := policyResp.AgentPolicy
72-
<<<<<<< HEAD
73-
_, err = tools.InstallPackageFromDefaultFile(ctx, info.KibanaClient, "fleet-server", preinstalledPackages["fleet-server"], "fleet-server.json", uuid.Must(uuid.NewV4()).String(), policy.ID)
74-
=======
7572

7673
packageFile := filepath.Join("testdata", "fleet-server.json")
7774
_, err = tools.InstallPackageFromDefaultFile(ctx, info.KibanaClient, "fleet-server", PreinstalledPackages["fleet-server"], packageFile, uuid.Must(uuid.NewV4()).String(), policy.ID)
78-
>>>>>>> 92e139ca2 ([tests] split up serverless and resource leaks integration tests (#8396))
7975
require.NoError(t, err, "failed creating fleet-server integration")
8076

8177
t.Log("Get fleet-server service token...")

testing/integration/logs_ingestion.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"context"
1212
"encoding/json"
1313
"fmt"
14+
"github.com/elastic/elastic-agent/pkg/testing/tools/fleettools"
1415
"net/http"
1516
"net/http/httptest"
1617
"net/http/httputil"
@@ -84,7 +85,7 @@ func LogIngestionFleetManaged(t *testing.T, info *define.Info) {
8485

8586
// 2. Install the Elastic-Agent with the policy that
8687
// was just created.
87-
policy, _, err := tools.InstallAgentWithPolicy(
88+
policy, err := tools.InstallAgentWithPolicy(
8889
ctx,
8990
t,
9091
installOpts,
@@ -186,8 +187,6 @@ func testMonitoringLogsAreShipped(
186187
"component %s: want %s, got %s",
187188
c.Name, client.Healthy, client.State(c.State))
188189
}
189-
agentID := status.Info.ID
190-
t.Logf("Agent ID: %q", agentID)
191190

192191
// Stage 3: Make sure there are no errors in logs
193192
t.Log("Making sure there are no error logs")
@@ -206,7 +205,6 @@ func testMonitoringLogsAreShipped(
206205
"add_cloud_metadata: received error for provider digitalocean: failed with http status code 404",
207206
"add_cloud_metadata: received error for provider azure: failed with http status code 404",
208207
"add_cloud_metadata: received error for provider openstack: failed with http status code 404",
209-
"add_cloud_metadata: received error for provider gcp: failed with http status code 404",
210208
"elastic-agent-client error: rpc error: code = Canceled desc = context canceled", // can happen on restart
211209
"failed to invoke rollback watcher: failed to start Upgrade Watcher", // on debian this happens probably need to fix.
212210
"falling back to IMDSv1: operation error ec2imds: getToken", // okay for the cloud metadata to not work
@@ -237,6 +235,16 @@ func testMonitoringLogsAreShipped(
237235
require.NotZero(t, len(docs.Hits.Hits))
238236

239237
// Stage 4: verify logs from the monitoring components are not sent to the output
238+
t.Log("Check monitoring logs")
239+
hostname, err := os.Hostname()
240+
if err != nil {
241+
t.Fatalf("could not get hostname to filter Agent: %s", err)
242+
}
243+
244+
agentID, err := fleettools.GetAgentIDByHostname(ctx, info.KibanaClient, policy.ID, hostname)
245+
require.NoError(t, err, "could not get Agent ID by hostname")
246+
t.Logf("Agent ID: %q", agentID)
247+
240248
// We cannot search for `component.id` because at the moment of writing
241249
// this field is not mapped. There is an issue for that:
242250
// https://github.com/elastic/integrations/issues/6545

0 commit comments

Comments
 (0)