rework comformance
Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>
This commit is contained in:
parent
be6f30391c
commit
dfd00d4152
|
@ -1,28 +1,48 @@
|
|||
terraform {
|
||||
required_version = ">=0.13"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = "~> 4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "aws" {
|
||||
region = "us-west-1"
|
||||
}
|
||||
|
||||
variable "RUN_ID" {
|
||||
type = string
|
||||
description = "Run Id of the github worklow run."
|
||||
}
|
||||
|
||||
resource "aws_sns_topic" "testTopic" {
|
||||
name = "testTopic"
|
||||
name = "testTopic-${var.RUN_ID}"
|
||||
tags = {
|
||||
dapr-topic-name = "testTopic"
|
||||
dapr-topic-name = "testTopic-${var.RUN_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_sns_topic" "multiTopic1" {
|
||||
name = "multiTopic1"
|
||||
name = "multiTopic1-${var.RUN_ID}"
|
||||
tags = {
|
||||
dapr-topic-name = "multiTopic1"
|
||||
dapr-topic-name = "multiTopic1-${var.RUN_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_sns_topic" "multiTopic2" {
|
||||
name = "multiTopic2"
|
||||
name = "multiTopic2-${var.RUN_ID}"
|
||||
tags = {
|
||||
dapr-topic-name = "multiTopic2"
|
||||
dapr-topic-name = "multiTopic2-${var.RUN_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_sqs_queue" "testQueue" {
|
||||
name = "testQueue"
|
||||
name = "testQueue-${var.RUN_ID}"
|
||||
tags = {
|
||||
dapr-queue-name = "testQueue"
|
||||
dapr-queue-name = "testQueue-${var.RUN_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,44 +71,24 @@ resource "aws_sqs_queue_policy" "testQueue_policy" {
|
|||
{
|
||||
"Version": "2012-10-17",
|
||||
"Id": "sqspolicy",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "First",
|
||||
"Effect": "Allow",
|
||||
"Principal": "*",
|
||||
"Action": "sqs:SendMessage",
|
||||
"Resource": "${aws_sqs_queue.testQueue.arn}",
|
||||
"Condition": {
|
||||
"ArnEquals": {
|
||||
"aws:SourceArn": "${aws_sns_topic.testTopic.arn}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Sid": "First",
|
||||
"Effect": "Allow",
|
||||
"Principal": "*",
|
||||
"Action": "sqs:SendMessage",
|
||||
"Resource": "${aws_sqs_queue.testQueue.arn}",
|
||||
"Condition": {
|
||||
"ArnEquals": {
|
||||
"aws:SourceArn": "${aws_sns_topic.multiTopic1.arn}"
|
||||
}
|
||||
}
|
||||
"Statement": [{
|
||||
"Sid": "Allow-SNS-SendMessage",
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"Service": "sns.amazonaws.com"
|
||||
},
|
||||
{
|
||||
"Sid": "First",
|
||||
"Effect": "Allow",
|
||||
"Principal": "*",
|
||||
"Action": "sqs:SendMessage",
|
||||
"Resource": "${aws_sqs_queue.testQueue.arn}",
|
||||
"Condition": {
|
||||
"ArnEquals": {
|
||||
"aws:SourceArn": "${aws_sns_topic.multiTopic2.arn}"
|
||||
}
|
||||
"Action": "sqs:SendMessage",
|
||||
"Resource": "${aws_sqs_queue.testQueue.arn}",
|
||||
"Condition": {
|
||||
"ArnEquals": {
|
||||
"aws:SourceArn": [
|
||||
"${aws_sns_topic.testTopic.arn}",
|
||||
"${aws_sns_topic.multiTopic1.arn}",
|
||||
"${aws_sns_topic.multiTopic2.arn}"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}]
|
||||
}
|
||||
POLICY
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ jobs:
|
|||
shell: bash
|
||||
needs: generate-matrix
|
||||
env:
|
||||
UUID: ${{github.run_id}}
|
||||
RUN_ID: ${{github.run_id}}
|
||||
|
||||
strategy:
|
||||
fail-fast: false # Keep running even if one component fails
|
||||
|
@ -246,7 +246,7 @@ jobs:
|
|||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
|
||||
aws-region: us-west-2
|
||||
aws-region: us-west-1
|
||||
if: matrix.terraform-dir != ''
|
||||
|
||||
- name: Terraform Init
|
||||
|
@ -263,12 +263,12 @@ jobs:
|
|||
|
||||
- name: Terraform Plan
|
||||
id: plan
|
||||
run: terraform plan -no-color -var="UUID=${{github.run_id}}"
|
||||
run: terraform plan -no-color -var="RUN_ID=${{github.run_id}}"
|
||||
working-directory: "./.github/infrastructure/terraform/certification/${{ matrix.terraform-dir }}"
|
||||
if: matrix.terraform-dir != ''
|
||||
|
||||
- name: Terraform Apply
|
||||
run: terraform apply -auto-approve -var="UUID=${{github.run_id}}"
|
||||
run: terraform apply -auto-approve -var="RUN_ID=${{github.run_id}}"
|
||||
working-directory: "./.github/infrastructure/terraform/certification/${{ matrix.terraform-dir }}"
|
||||
if: matrix.terraform-dir != ''
|
||||
continue-on-error: true
|
||||
|
@ -391,7 +391,7 @@ jobs:
|
|||
|
||||
- name: Terraform Destroy
|
||||
continue-on-error: true
|
||||
run: terraform destroy -auto-approve -var="UUID=${{github.run_id}}"
|
||||
run: terraform destroy -auto-approve -var="RUN_ID=${{github.run_id}}"
|
||||
working-directory: "./.github/infrastructure/terraform/certification/${{ matrix.terraform-dir }}"
|
||||
if: matrix.terraform-dir != ''
|
||||
|
||||
|
|
|
@ -146,11 +146,20 @@ jobs:
|
|||
required-secrets: AzureKeyVaultName,AzureKeyVaultSecretStoreTenantId,AzureKeyVaultSecretStoreServicePrincipalClientId,AzureKeyVaultSecretStoreServicePrincipalClientSecret
|
||||
- component: bindings.azure.cosmosdb
|
||||
required-secrets: AzureCosmosDBMasterKey,AzureCosmosDBUrl,AzureCosmosDB,AzureCosmosDBCollection
|
||||
EOF
|
||||
)
|
||||
echo "::set-output name=cron-components::$CRON_COMPONENTS"
|
||||
|
||||
- name: Specify components requiring cloud resources to run and use terraform
|
||||
id: terraform-components
|
||||
run: |
|
||||
TERRAFORM_COMPONENTS=$(yq -I0 --tojson eval - << EOF
|
||||
- component: pubsub.aws.snssqs
|
||||
terraform-dir: pubsub/aws/snssqs
|
||||
EOF
|
||||
)
|
||||
echo "::set-output name=cron-components::$CRON_COMPONENTS"
|
||||
echo $TERRAFORM_COMPONENTS
|
||||
echo "::set-output name=terraform-components::$TERRAFORM_COMPONENTS"
|
||||
|
||||
- name: Create PR comment
|
||||
if: env.PR_NUMBER != ''
|
||||
|
@ -169,6 +178,7 @@ jobs:
|
|||
outputs:
|
||||
pr-components: ${{ steps.pr-components.outputs.pr-components }}
|
||||
cron-components: ${{ steps.cron-components.outputs.cron-components }}
|
||||
terraform-components: ${{ steps.terraform-components.outputs.terraform-components }}
|
||||
|
||||
conformance:
|
||||
name: ${{ matrix.component }} conformance
|
||||
|
@ -178,13 +188,15 @@ jobs:
|
|||
shell: bash
|
||||
needs: generate-matrix
|
||||
env:
|
||||
UUID: ${{github.run_id}}
|
||||
RUN_ID: ${{github.run_id}}
|
||||
|
||||
strategy:
|
||||
fail-fast: false # Keep running even if one component fails
|
||||
matrix:
|
||||
component: ${{ fromJson(needs.generate-matrix.outputs.pr-components) }}
|
||||
include: ${{ fromJson(needs.generate-matrix.outputs.cron-components) }}
|
||||
include:
|
||||
- ${{ fromJson(needs.generate-matrix.outputs.cron-components) }}
|
||||
- ${{ fromJson(needs.generate-matrix.outputs.terraform-components) }}
|
||||
|
||||
steps:
|
||||
- name: Set default payload repo and ref
|
||||
|
@ -266,7 +278,7 @@ jobs:
|
|||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
|
||||
aws-region: us-west-2
|
||||
aws-region: us-west-1
|
||||
if: matrix.terraform-dir != ''
|
||||
|
||||
- name: Terraform Init
|
||||
|
@ -283,12 +295,12 @@ jobs:
|
|||
|
||||
- name: Terraform Plan
|
||||
id: plan
|
||||
run: terraform plan -no-color
|
||||
run: terraform plan -no-color -var="RUN_ID=${{github.run_id}}"
|
||||
working-directory: "./.github/infrastructure/terraform/conformance/${{ matrix.terraform-dir }}"
|
||||
if: matrix.terraform-dir != ''
|
||||
|
||||
- name: Terraform Apply
|
||||
run: terraform apply -auto-approve
|
||||
run: terraform apply -auto-approve -var="RUN_ID=${{github.run_id}}"
|
||||
working-directory: "./.github/infrastructure/terraform/conformance/${{ matrix.terraform-dir }}"
|
||||
if: matrix.terraform-dir != ''
|
||||
continue-on-error: true
|
||||
|
@ -308,6 +320,18 @@ jobs:
|
|||
mongodb-replica-set: test-rs
|
||||
if: contains(matrix.component, 'mongodb')
|
||||
|
||||
- name: Create aws.snssqs variables
|
||||
run: |
|
||||
PUBSUB_AWS_SNSSQS_QUEUE="testQueue-${{ github.run_id }}"
|
||||
echo "PUBSUB_AWS_SNSSQS_QUEUE=$PUBSUB_AWS_SNSSQS_QUEUE" >> $GITHUB_ENV
|
||||
PUBSUB_AWS_SNSSQS_TOPIC="testTopic-${{ github.run_id }}"
|
||||
echo "PUBSUB_AWS_SNSSQS_TOPIC=$PUBSUB_AWS_SNSSQS_TOPIC" >> $GITHUB_ENV
|
||||
PUBSUB_AWS_SNSSQS_TOPIC_MULTI_1="multiTopic1-${{ github.run_id }}"
|
||||
echo "PUBSUB_AWS_SNSSQS_TOPIC_MULTI_1=$PUBSUB_AWS_SNSSQS_TOPIC_MULTI_1" >> $GITHUB_ENV
|
||||
PUBSUB_AWS_SNSSQS_TOPIC_MULTI_2="multiTopic2-${{ github.run_id }}"
|
||||
echo "PUBSUB_AWS_SNSSQS_TOPIC_MULTI_2=$PUBSUB_AWS_SNSSQS_TOPIC_MULTI_2" >> $GITHUB_ENV
|
||||
if: contains(matrix.component, 'snssqs')
|
||||
|
||||
- name: Start sqlserver
|
||||
run: docker-compose -f ./.github/infrastructure/docker-compose-sqlserver.yml -p sqlserver up -d
|
||||
if: contains(matrix.component, 'sqlserver')
|
||||
|
@ -497,7 +521,7 @@ jobs:
|
|||
|
||||
- name: Terraform Destroy
|
||||
continue-on-error: true
|
||||
run: terraform destroy -auto-approve
|
||||
run: terraform destroy -auto-approve -var="RUN_ID=${{github.run_id}}"
|
||||
working-directory: "./.github/infrastructure/terraform/conformance/${{ matrix.terraform-dir }}"
|
||||
if: matrix.terraform-dir != ''
|
||||
|
||||
|
@ -570,7 +594,8 @@ jobs:
|
|||
script: |
|
||||
const prComponents = ('${{ needs.generate-matrix.outputs.pr-components }}' && JSON.parse('${{ needs.generate-matrix.outputs.pr-components }}')) || []
|
||||
const cronComponents = ('${{ needs.generate-matrix.outputs.cron-components }}' && JSON.parse('${{ needs.generate-matrix.outputs.cron-components }}')) || []
|
||||
const allComponents = [...prComponents, ...cronComponents]
|
||||
const terraformComponents = ('${{ needs.generate-matrix.outputs.terraform-components }}' && JSON.parse('${{ needs.generate-matrix.outputs.terraform-components }}')) || []
|
||||
const allComponents = [...prComponents, ...cronComponents, ...cloudComponents]
|
||||
const basePath = '${{ steps.testresults.outputs.download-path }}'
|
||||
const testType = 'conformance'
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ spec:
|
|||
- name: secretKey
|
||||
value: ${{AWS_SECRET_ACCESS_KEY}}
|
||||
- name: region
|
||||
value: "us-west-2"
|
||||
value: "us-west-1"
|
||||
- name: consumerID
|
||||
value: "testQueue"
|
||||
value: ${{PUBSUB_AWS_SNSSQS_QUEUE}}
|
||||
- name: messageVisibilityTimeout
|
||||
value: 10
|
||||
- name: messageRetryLimit
|
||||
|
|
|
@ -79,6 +79,10 @@ components:
|
|||
- component: aws.snssqs
|
||||
operations: ["publish", "subscribe", "multiplehandlers"]
|
||||
config:
|
||||
pubsubName: aws-snssqs
|
||||
testTopicName: ${{PUBSUB_AWS_SNSSQS_TOPIC}}
|
||||
testMultiTopic1Name: ${{PUBSUB_AWS_SNSSQS_TOPIC_MULTI_1}}
|
||||
testMultiTopic2Name: ${{PUBSUB_AWS_SNSSQS_TOPIC_MULTI_2}}
|
||||
checkInOrderProcessing: false
|
||||
- component: kubemq
|
||||
operations: ["publish", "subscribe", "multiplehandlers"]
|
||||
|
|
|
@ -159,6 +159,10 @@ func ParseConfigurationMap(t *testing.T, configMap map[string]interface{}) {
|
|||
val = uuid.New().String()
|
||||
t.Logf("Generated UUID %s", val)
|
||||
configMap[k] = val
|
||||
} else if strings.Contains(val, "${{") {
|
||||
s := strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(val, "${{"), "}}"))
|
||||
v := LookUpEnv(s)
|
||||
configMap[k] = v
|
||||
} else {
|
||||
jsonMap := make(map[string]interface{})
|
||||
err := json.Unmarshal([]byte(val), &jsonMap)
|
||||
|
@ -187,6 +191,10 @@ func parseConfigurationInterfaceMap(t *testing.T, configMap map[interface{}]inte
|
|||
val = uuid.New().String()
|
||||
t.Logf("Generated UUID %s", val)
|
||||
configMap[k] = val
|
||||
} else if strings.Contains(val, "${{") {
|
||||
s := strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(val, "${{"), "}}"))
|
||||
v := LookUpEnv(s)
|
||||
configMap[k] = v
|
||||
} else {
|
||||
jsonMap := make(map[string]interface{})
|
||||
err := json.Unmarshal([]byte(val), &jsonMap)
|
||||
|
|
Loading…
Reference in New Issue