Skip to content
Open
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
1 change: 0 additions & 1 deletion .github/workflows/component-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:

jobs:
component-test:
if : false # temporarily disable component tests
runs-on: ubuntu-latest

env:
Expand Down
27 changes: 0 additions & 27 deletions tests/component-tests/promotion/00-dragAndDrop/00-assert.yaml

This file was deleted.

This file was deleted.

86 changes: 0 additions & 86 deletions tests/component-tests/promotion/00-dragAndDrop/dragAndDrop.json

This file was deleted.

16 changes: 0 additions & 16 deletions tests/component-tests/promotion/00-dragAndDrop/dragAndDrop.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
---
apiVersion: kuttl.dev/v1beta1
commands:
- script: >
STATUS="$(kubectl get workflow -n codefresh -l codefresh.io/release=684040897b3903d3764e1f73 -o jsonpath="{.items[*].status.phase}")"

if [ $STATUS = 'Succeeded' ]; then
echo "workflow status for release '684040897b3903d3764e1f73' has succeeded"
else
echo "workflow status ($STATUS) for release '684040897b3903d3764e1f73' should be succeeded"
exit 1
fi
- script: >
STATUS="$(kubectl get promotiontask -n codefresh -l codefresh.io/id=635ae4b1a8d4ea001297e0e9 -o jsonpath="{.items[*].status.phase}")"
if [ $STATUS = 'Succeeded' ]; then
echo "promotion task status for promotion task '635ae4b1a8d4ea001297e0e9' has succeeded"
else
echo "workflow status ($STATUS) for promotion task '635ae4b1a8d4ea001297e0e9' should be succeeded"
exit 1
fi
kind: TestAssert
timeout: 240
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[
{
"httpRequest": {
"method": "GET",
"path": "/2.0/api/promotion-orchestrator/promotion/desired-promotion-tasks"
},
"httpResponse": {
"statusCode": 200,
"body": [
{
"promotionTaskId": "635ae4b1a8d4ea001297e0e9",
"name": "dev-codefresh-simple-dev-68ea7699e1e47d0cd666f6b9",
"promotionId": "68ea7699e1e47d0cd666f6b8",
"productName": "echo",
"environment": "dev",
"applicationId": {
"name": "simple-dev",
"namespace": "codefresh"
},
"spec": {
"phase": "PENDING",
"steps": [
{
"type": "getPromotionValues",
"targetApplication": {
"name": "simple-dev",
"namespace": "codefresh"
},
"commitSha": "source-commit-sha",
"versionProperty": {
"file": "Chart.yaml",
"jsonPath": "$.version"
},
"commitAuthorId": {
"username": "test-user",
"email": "test-user@example.com"
},
"promotionProperties": [
{
"file": "values.yaml",
"properties": [
"$.image.tag"
]
}
]
},
{
"type": "verifyApp",
"targetApplication": {
"name": "simple-dev",
"namespace": "codefresh"
},
"commitSha": "source-commit-sha"
}
]
}
}
]

},
"times": {
"remainingTimes":1,
"unlimited": false
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# -----------------------------------------------------------------------------
# Usage:
# ./00-get-promotable-values.sh
#
# Steps performed:
# - Updates the image tag in values.yaml from '0.1' to 'latest'.
# - Commits and pushes the change to the simple-app repository.
# - Retrieves the latest commit SHA.
# - Updates the mock JSON files with the new commit SHA.
# - Loads the updated expectations into Mockserver.
# -----------------------------------------------------------------------------
sleep 2
OS_TYPE=$(uname)
cd ../../setup/simple-app
git checkout dev

if [ "$OS_TYPE" = "Linux" ]; then
sed -i 's/latest/0.1/g' values.yaml
else
sed -i '' 's/latest/0.1/g' values.yaml
fi

git add --a
git commit -m "update values.yaml"
git push
srcCommitSha=$(git rev-parse origin/dev)
## update commit sha for dev app
if [ "$OS_TYPE" = "Linux" ]; then
sed -i "s/source-commit-sha/$srcCommitSha/g" ../../promotion/00-get-promotable-values/00-get-promotable-values.json
else
sed -i '' "s/source-commit-sha/$srcCommitSha/g" ../../promotion/00-get-promotable-values/00-get-promotable-values.json
fi
sleep 5
curl -i -X PUT http://127.0.0.1:1080/mockserver/expectation --data-binary "@../../promotion/00-get-promotable-values/00-get-promotable-values.json"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -----------------------------------------------------------------------------
# 00-app-sync.yaml - KUTTL TestStep for app sync and mock update
#
# This TestStep runs the 00-app-sync.sh script to update the simple-app
# repository and load updated sync mock expectations into Mockserver for the
# Codefresh GitOps Operator component tests.
#
# Usage:
# This step is executed as part of the KUTTL test suite.
#
# Steps performed:
# - Executes the 00-app-sync.sh script to update the app and mocks.
# -----------------------------------------------------------------------------
---
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: ./00-get-promotable-values.sh
timeout: 30
Loading
Loading