fix: correct Python indentation in Jenkins CI smoke tests
startup-product-gitea-ci/pipeline/pr-main This commit looks good
startup-product-gitea-ci/pipeline/pr-main This commit looks good
This commit is contained in:
Vendored
+4
-48
@@ -48,23 +48,8 @@ pipeline {
|
||||
steps {
|
||||
sh '''
|
||||
set -eu
|
||||
|
||||
curl -fsS --max-time 10 \
|
||||
http://startup-pricing-staging:5000/health \
|
||||
-o /tmp/pricing-health.json
|
||||
|
||||
python3 -c '
|
||||
import json
|
||||
|
||||
with open("/tmp/pricing-health.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
assert data["status"] == "healthy"
|
||||
assert data["version"] == "v2"
|
||||
|
||||
print("Staging health check PASSED")
|
||||
print("Version:", data["version"])
|
||||
'
|
||||
curl -fsS --max-time 10 http://startup-pricing-staging:5000/health -o /tmp/pricing-health.json
|
||||
python3 -c 'import json; data=json.load(open("/tmp/pricing-health.json")); assert data["status"] == "healthy"; assert data["version"] == "v2"; print("Staging health check PASSED")'
|
||||
'''
|
||||
}
|
||||
}
|
||||
@@ -73,37 +58,8 @@ pipeline {
|
||||
steps {
|
||||
sh '''
|
||||
set -eu
|
||||
|
||||
curl -fsS --max-time 10 \
|
||||
http://startup-pricing-staging:5000/pricing \
|
||||
-o /tmp/pricing-response.json
|
||||
|
||||
python3 -c '
|
||||
import json
|
||||
|
||||
with open("/tmp/pricing-response.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
assert data["version"] == "v2"
|
||||
|
||||
plans = data["plans"]
|
||||
expected = {
|
||||
"Starter": 5,
|
||||
"Basic": 12,
|
||||
"Pro": 30,
|
||||
"Enterprise": 60
|
||||
}
|
||||
|
||||
actual = {
|
||||
plan["name"]: plan["price"]
|
||||
for plan in plans
|
||||
}
|
||||
|
||||
assert actual == expected
|
||||
|
||||
print("Pricing smoke test PASSED")
|
||||
print("All four pricing plans verified")
|
||||
'
|
||||
curl -fsS --max-time 10 http://startup-pricing-staging:5000/pricing -o /tmp/pricing-response.json
|
||||
python3 -c 'import json; data=json.load(open("/tmp/pricing-response.json")); assert data["version"] == "v2"; actual={p["name"]:p["price"] for p in data["plans"]}; assert actual == {"Starter":5,"Basic":12,"Pro":30,"Enterprise":60}; print("Pricing smoke test PASSED")'
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user