Skip to content

Commit b76859f

Browse files
Andrea Spaccamergify-bot
authored andcommitted
[Filebeat] Integration tests in CI for AWS-S3 input (#27491)
* [Filebeat] Integration tests in CI for AWS-S3 input (cherry picked from commit 9d4597a)
1 parent 93caf2f commit b76859f

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

Jenkinsfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pipeline {
2222
RUNBLD_DISABLE_NOTIFICATIONS = 'true'
2323
SLACK_CHANNEL = "#beats-build"
2424
SNAPSHOT = 'true'
25-
TERRAFORM_VERSION = "0.12.30"
25+
TERRAFORM_VERSION = "0.13.7"
2626
XPACK_MODULE_PATTERN = '^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*'
2727
}
2828
options {
@@ -832,8 +832,10 @@ def withCloudTestEnv(Closure body) {
832832
def maskedVars = []
833833
def testTags = "${env.TEST_TAGS}"
834834

835-
// AWS
836-
if (params.allCloudTests || params.awsCloudTests) {
835+
// Allow AWS credentials when the build was configured to do so with:
836+
// - the cloudtests build parameters
837+
// - the aws github label
838+
if (params.allCloudTests || params.awsCloudTests || matchesPrLabel(label: 'aws')) {
837839
testTags = "${testTags},aws"
838840
def aws = getVaultSecret(secret: "${AWS_ACCOUNT_SECRET}").data
839841
if (!aws.containsKey('access_key')) {
@@ -885,6 +887,7 @@ def startCloudTestEnv(Map args = [:]) {
885887
// If it failed then cleanup without failing the build
886888
sh(label: 'Terraform Cleanup', script: ".ci/scripts/terraform-cleanup.sh ${folder}", returnStatus: true)
887889
}
890+
error('startCloudTestEnv: terraform apply failed.')
888891
} finally {
889892
// Archive terraform states in case manual cleanup is needed.
890893
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/terraform.tfstate')

x-pack/filebeat/Jenkinsfile.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ stages:
9393
platforms: ## override default labels in this specific stage.
9494
- "windows-7"
9595
stage: extended
96+
cloud:
97+
cloud: "mage build test"
98+
withModule: true ## run the ITs only if the changeset affects a specific module.
99+
dirs: ## apply terraform for the given directory.
100+
- "x-pack/filebeat/input/awss3/_meta/terraform"
101+
when: ## Override the top-level when.
102+
parameters:
103+
- "awsCloudTests"
104+
comments:
105+
- "/test x-pack/filebeat for aws cloud"
106+
labels:
107+
- "aws"
108+
stage: extended
96109
#windows-7-32: See https://github.com/elastic/beats/issues/22315
97110
# mage: "mage build unitTest"
98111
# platforms: ## override default labels in this specific stage.

x-pack/metricbeat/module/aws/terraform.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ resource "aws_s3_bucket_object" "test" {
5050
resource "aws_instance" "test" {
5151
ami = data.aws_ami.latest-amzn.id
5252
monitoring = true
53-
instance_type = "t1.micro"
53+
instance_type = "t2.micro"
5454
tags = {
5555
Name = "metricbeat-test"
5656
}

0 commit comments

Comments
 (0)