Skip to content

Commit

Permalink
Revert "Revert "Run docker fake intake test with new version of the f…
Browse files Browse the repository at this point in the history
…akeintake if mod…"" (#24587)

* Revert "Revert "Run docker fake intake test with new version of the fakeintak…"

This reverts commit ffb080b.

* Remove hyphen
  • Loading branch information
KevinFairise2 authored and chouetz committed Nov 18, 2024
1 parent b7e2255 commit 4a36890
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 20 deletions.
47 changes: 31 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ stages:
- package_build
- packaging
- kitchen_deploy
- e2e_pre_test
- kitchen_testing
- pkg_metrics
- container_build
Expand All @@ -89,6 +88,7 @@ stages:
- choco_deploy
- internal_image_deploy
- install_script_testing
- e2e_pre_test
- e2e
- kitchen_cleanup
- functional_test
Expand Down Expand Up @@ -367,6 +367,15 @@ variables:
.if_mergequeue: &if_mergequeue
if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/

.fakeintake_changes: &fakeintake_changes
changes:
paths:
- "test/fakeintake/**/*"
- .gitlab/binary_build/fakeintake.yml
- .gitlab/container_build/fakeintake.yml
- .gitlab/dev_container_deploy/fakeintake.yml
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916

#
# Workflow rules
# Rules used to define whether a pipeline should run, and with which variables
Expand Down Expand Up @@ -772,6 +781,23 @@ workflow:

# New E2E related rules

.on_e2e_or_fakeintake_changes_or_manual:
- <<: *if_main_branch
- !reference [.except_mergequeue]
- <<: *fakeintake_changes
variables:
FAKEINTAKE_IMAGE_OVERRIDE: "public.ecr.aws/datadog/fakeintake:v$CI_COMMIT_SHORT_SHA"
when: on_success
- changes:
paths:
- test/new-e2e/pkg/**/*
- test/new-e2e/test-infra-definition/*
- test/new-e2e/go.mod
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916
when: on_success
- when: manual
allow_failure: true


.on_e2e_main_release_or_rc: # This rule is used as a base for all new-e2e rules
- <<: *if_disable_e2e_tests
Expand Down Expand Up @@ -1086,23 +1112,12 @@ workflow:
- .go-version
compare_to: 6.53.x # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916

.on_fakeintake_changes: &on_fakeintake_changes
changes:
- "test/fakeintake/**/*"
- .gitlab/binary_build/fakeintake.yml
- .gitlab/container_build/fakeintake.yml
- .gitlab/dev_container_deploy/fakeintake.yml

.on_fakeintake_changes_on_main_or_manual:
- <<: *on_fakeintake_changes
if: $CI_COMMIT_BRANCH == "6.53.x"
- <<: *on_fakeintake_changes
when: manual
allow_failure: true
.on_fakeintake_changes:
- <<: *fakeintake_changes

.on_fakeintake_changes_on_main:
- <<: *on_fakeintake_changes
if: $CI_COMMIT_BRANCH == "6.53.x"
- <<: *fakeintake_changes
<<: *if_main_branch

.fast_on_dev_branch_only:
- <<: *if_main_branch
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/dev_container_deploy/fakeintake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish_fakeintake:
stage: dev_container_deploy
rules:
- !reference [.except_mergequeue]
- !reference [.on_fakeintake_changes_on_main_or_manual]
- !reference [.on_fakeintake_changes]
needs:
- job: docker_build_fakeintake
optional: false
Expand Down
6 changes: 4 additions & 2 deletions .gitlab/e2e_pre_test/e2e_pre_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# Contains jobs which runs e2e tests to validate the new-e2e framework.
e2e_pre_test:
rules:
- !reference [.on_e2e_changes_or_manual]
- !reference [.on_e2e_or_fakeintake_changes_or_manual]
stage: e2e_pre_test
extends: .new_e2e_template
needs: []
needs:
- job: publish_fakeintake
optional: true
script:
- inv -e new-e2e-tests.run --targets ./test-infra-definition --junit-tar "junit-${CI_JOB_NAME}.tgz" ${EXTRA_PARAMS}
after_script:
Expand Down
11 changes: 10 additions & 1 deletion test/new-e2e/test-infra-definition/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package testinfradefinition

import (
"fmt"
"os"
"regexp"
"testing"
"time"
Expand All @@ -15,6 +16,7 @@ import (
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient"
"github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake"
"github.com/stretchr/testify/assert"
)

Expand All @@ -23,7 +25,14 @@ type dockerSuite struct {
}

func TestDocker(t *testing.T) {
e2e.Run(t, &dockerSuite{}, e2e.WithProvisioner(awsdocker.Provisioner()))
var fakeintakeOpts []fakeintake.Option

// When we modify the fakeintake, this test will run with the new version of the fakeintake
if fakeintakeImage, ok := os.LookupEnv("FAKEINTAKE_IMAGE_OVERRIDE"); ok {
t.Logf("Running with fakeintake image %s", fakeintakeImage)
fakeintakeOpts = append(fakeintakeOpts, fakeintake.WithImageURL(fakeintakeImage))
}
e2e.Run(t, &dockerSuite{}, e2e.WithProvisioner(awsdocker.Provisioner(awsdocker.WithFakeIntakeOptions(fakeintakeOpts...))))
}

func (v *dockerSuite) TestExecuteCommand() {
Expand Down

0 comments on commit 4a36890

Please sign in to comment.