-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_integration_tests.sh
More file actions
executable file
·69 lines (58 loc) · 2.2 KB
/
Copy pathrun_integration_tests.sh
File metadata and controls
executable file
·69 lines (58 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Integration Test Runner for drone-har plugin
# This script runs integration tests against a real Harness Artifact Registry
set -e
echo "🔧 Harness Artifact Registry - Integration Test Runner"
echo "======================================================="
echo ""
# Check if credentials are provided via environment variables
if [ -z "$HARNESS_TOKEN" ]; then
echo "⚠️ HARNESS_TOKEN environment variable is not set"
echo ""
echo "Please set your Harness credentials:"
echo " export HARNESS_TOKEN='your-token'"
echo " export HARNESS_ACCOUNT='your-account-id'"
echo " export HARNESS_ORG='default' # optional"
echo " export HARNESS_PROJECT='jatintest' # optional"
echo " export HARNESS_PKG_URL='https://pkg.harness.io' # optional"
echo ""
exit 1
fi
if [ -z "$HARNESS_ACCOUNT" ]; then
echo "⚠️ HARNESS_ACCOUNT environment variable is not set"
exit 1
fi
# Set defaults
export HARNESS_ORG=${HARNESS_ORG:-"default"}
export HARNESS_PROJECT=${HARNESS_PROJECT:-"jatintest"}
export HARNESS_PKG_URL=${HARNESS_PKG_URL:-"https://pkg.harness.io"}
echo "✅ Credentials configured:"
echo " Account: $HARNESS_ACCOUNT"
echo " Org: $HARNESS_ORG"
echo " Project: $HARNESS_PROJECT"
echo " Pkg URL: $HARNESS_PKG_URL"
echo ""
# Run integration tests
echo "🧪 Running integration tests..."
echo ""
if [ "$1" == "full" ]; then
echo "Running full workflow test..."
go test -tags=integration -v -run TestIntegration_FullWorkflow ./plugin/...
elif [ "$1" == "push" ]; then
echo "Running push test..."
go test -tags=integration -v -run TestIntegration_PushArtifact ./plugin/...
elif [ "$1" == "get" ]; then
echo "Running get test..."
go test -tags=integration -v -run TestIntegration_GetArtifact ./plugin/...
elif [ "$1" == "pull" ]; then
echo "Running pull test..."
go test -tags=integration -v -run TestIntegration_PullArtifact ./plugin/...
elif [ "$1" == "delete" ]; then
echo "Running delete test..."
go test -tags=integration -v -run TestIntegration_DeleteArtifact ./plugin/...
else
echo "Running all integration tests..."
go test -tags=integration -v ./plugin/...
fi
echo ""
echo "✅ Integration tests completed!"