Skip to content
Merged
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
2 changes: 1 addition & 1 deletion internal/updater/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (s *UpdateState) HasUpdate(currentVersion string) bool {
return false
}
// Never show update notification for dev builds
if currentVersion == "dev" {
if currentVersion == "dev" || currentVersion == "main" {
return false
}
return CompareVersions(s.LatestVersion, currentVersion) > 0
Expand Down
6 changes: 6 additions & 0 deletions internal/updater/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ func TestHasUpdate(t *testing.T) {
currentVersion: "dev",
expected: false,
},
{
name: "main version never shows update",
latestVersion: "v0.0.10",
currentVersion: "main",
expected: false,
},
}

for _, tt := range tests {
Expand Down
16 changes: 8 additions & 8 deletions test/e2e/rerun.bats
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ get_workflow_id() {
}

@test "1. Create test workflow definition" {
run ./orkes workflow create "$WORKFLOW_FILE" --force
run bash -c "./orkes workflow create '$WORKFLOW_FILE' --force 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]
}

@test "2. Start workflow execution" {
run ./orkes execution start --workflow "$WORKFLOW_NAME"
run bash -c "./orkes execution start --workflow '$WORKFLOW_NAME' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -44,7 +44,7 @@ get_workflow_id() {

# Wait up to 10 seconds for workflow to complete
for i in {1..10}; do
run ./orkes execution status "$WORKFLOW_ID"
run bash -c "./orkes execution status '$WORKFLOW_ID' 2>/dev/null"
echo "Attempt $i: Status = $output"

if [ "$output" = "COMPLETED" ]; then
Expand All @@ -61,7 +61,7 @@ get_workflow_id() {
WORKFLOW_ID=$(cat /tmp/rerun_workflow_id.txt)
[ -n "$WORKFLOW_ID" ]

run ./orkes execution get "$WORKFLOW_ID"
run bash -c "./orkes execution get '$WORKFLOW_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -73,7 +73,7 @@ get_workflow_id() {
WORKFLOW_ID=$(cat /tmp/rerun_workflow_id.txt)
[ -n "$WORKFLOW_ID" ]

run ./orkes execution rerun "$WORKFLOW_ID"
run bash -c "./orkes execution rerun '$WORKFLOW_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -92,7 +92,7 @@ get_workflow_id() {

# Wait up to 10 seconds for rerun workflow to complete
for i in {1..10}; do
run ./orkes execution status "$WORKFLOW_ID"
run bash -c "./orkes execution status '$WORKFLOW_ID' 2>/dev/null"
echo "Attempt $i: Rerun status = $output"

if [ "$output" = "COMPLETED" ]; then
Expand All @@ -109,14 +109,14 @@ get_workflow_id() {
WORKFLOW_ID=$(cat /tmp/rerun_workflow_id.txt)
[ -n "$WORKFLOW_ID" ]

run ./orkes execution delete "$WORKFLOW_ID"
run bash -c "./orkes execution delete '$WORKFLOW_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]
echo "Deleted workflow UUID: $WORKFLOW_ID"
}

@test "8. Cleanup - Delete workflow definition" {
run ./orkes workflow delete "$WORKFLOW_NAME" 1
run bash -c "./orkes workflow delete '$WORKFLOW_NAME' 1 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]
}
20 changes: 10 additions & 10 deletions test/e2e/webhook.bats
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ get_webhook_id() {
}

@test "1. Create webhook using command flags" {
run ./orkes webhook create \
run bash -c "./orkes webhook create \
--name custom_webhook_1 \
--source-platform Custom \
--verifier HEADER_BASED \
--headers "Authorization:BB12346789" \
--receiver-workflows hello_world:1
--headers 'Authorization:BB12346789' \
--receiver-workflows hello_world:1 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -43,7 +43,7 @@ get_webhook_id() {
WEBHOOK_ID=$(cat /tmp/webhook_test_id.txt)
[ -n "$WEBHOOK_ID" ]

run ./orkes webhook get "$WEBHOOK_ID"
run bash -c "./orkes webhook get '$WEBHOOK_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -57,7 +57,7 @@ get_webhook_id() {
WEBHOOK_ID=$(cat /tmp/webhook_test_id.txt)
[ -n "$WEBHOOK_ID" ]

run ./orkes webhook list
run bash -c "./orkes webhook list 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -70,7 +70,7 @@ get_webhook_id() {
WEBHOOK_ID=$(cat /tmp/webhook_test_id.txt)
[ -n "$WEBHOOK_ID" ]

run ./orkes webhook list --json
run bash -c "./orkes webhook list --json 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand Down Expand Up @@ -98,7 +98,7 @@ get_webhook_id() {
}
EOF

run ./orkes webhook update "$WEBHOOK_ID" --file /tmp/webhook_update.json
run bash -c "./orkes webhook update '$WEBHOOK_ID' --file /tmp/webhook_update.json 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -110,7 +110,7 @@ EOF
WEBHOOK_ID=$(cat /tmp/webhook_test_id.txt)
[ -n "$WEBHOOK_ID" ]

run ./orkes webhook get "$WEBHOOK_ID"
run bash -c "./orkes webhook get '$WEBHOOK_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -124,7 +124,7 @@ EOF
WEBHOOK_ID=$(cat /tmp/webhook_test_id.txt)
[ -n "$WEBHOOK_ID" ]

run ./orkes webhook delete "$WEBHOOK_ID"
run bash -c "./orkes webhook delete '$WEBHOOK_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -137,7 +137,7 @@ EOF
[ -n "$WEBHOOK_ID" ]

# Getting deleted webhook should fail
run ./orkes webhook get "$WEBHOOK_ID"
run bash -c "./orkes webhook get '$WEBHOOK_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -ne 0 ]
}
Expand Down
18 changes: 9 additions & 9 deletions test/e2e/workflow.bats
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ get_workflow_id() {
}

@test "1. Create workflow definition" {
run ./orkes workflow create "$WORKFLOW_FILE" --force
run bash -c "./orkes workflow create '$WORKFLOW_FILE' --force 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]
}

@test "2. Get workflow definition" {
run ./orkes workflow get "$WORKFLOW_NAME"
run bash -c "./orkes workflow get '$WORKFLOW_NAME' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]
[[ "$output" == *"$WORKFLOW_NAME"* ]]
[[ "$output" == *"wait_task"* ]]
}

@test "3. Start workflow execution" {
run ./orkes execution start --workflow "$WORKFLOW_NAME"
run bash -c "./orkes execution start --workflow '$WORKFLOW_NAME' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]

Expand All @@ -51,7 +51,7 @@ get_workflow_id() {
WORKFLOW_ID=$(cat /tmp/workflow_id.txt)
[ -n "$WORKFLOW_ID" ]

run ./orkes execution status "$WORKFLOW_ID"
run bash -c "./orkes execution status '$WORKFLOW_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]
[[ "$output" == "RUNNING" ]]
Expand All @@ -62,7 +62,7 @@ get_workflow_id() {
WORKFLOW_ID=$(cat /tmp/workflow_id.txt)
[ -n "$WORKFLOW_ID" ]

run ./orkes execution terminate "$WORKFLOW_ID"
run bash -c "./orkes execution terminate '$WORKFLOW_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]
echo "Terminated workflow UUID: $WORKFLOW_ID"
Expand All @@ -76,7 +76,7 @@ get_workflow_id() {
# Wait a moment for termination to process
sleep 2

run ./orkes execution status "$WORKFLOW_ID"
run bash -c "./orkes execution status '$WORKFLOW_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]
[[ "$output" == "TERMINATED" ]]
Expand All @@ -87,7 +87,7 @@ get_workflow_id() {
WORKFLOW_ID=$(cat /tmp/workflow_id.txt)
[ -n "$WORKFLOW_ID" ]

run ./orkes execution delete "$WORKFLOW_ID"
run bash -c "./orkes execution delete '$WORKFLOW_ID' 2>/dev/null"
echo "Output: $output"
[ "$status" -eq 0 ]
echo "Deleted workflow UUID: $WORKFLOW_ID"
Expand All @@ -101,14 +101,14 @@ get_workflow_id() {
# Wait a moment for deletion to process
sleep 2

run ./orkes execution status "$WORKFLOW_ID"
run bash -c "./orkes execution status '$WORKFLOW_ID' 2>/dev/null"
echo "Output: $output"
# Should fail since the execution was deleted
[ "$status" -ne 0 ]
}

@test "9. Cleanup - delete workflow definition" {
run ./orkes workflow delete "$WORKFLOW_NAME" 1
run bash -c "./orkes workflow delete '$WORKFLOW_NAME' 1 2>/dev/null"
echo "Output: $output"
# Clean up the temp file
rm -f /tmp/workflow_id.txt
Expand Down
Loading