Compare commits

..
Author SHA1 Message Date
Cedric PollefeysandClaude Opus 5.5 58fd9947db Drill: bind the app to the wrong port (staging only, do not merge)
seat-back-trivia/pipeline/head This commit looks good
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:28:09 -05:00
cedric 67ccd237a8 Merge pull request 'Release pricing v2' (#19) from pricing-v2 into main
seat-back-trivia/pipeline/head This commit looks good
Reviewed-on: #19
Reviewed-by: natalie <naragon@stevens.edu>
2026-11-05 00:17:29 +00:00
cedric 3dc7e946cd Merge pull request 'Record the v1 release' (#18) from release-v1-records into main
seat-back-trivia/pipeline/head This commit looks good
Reviewed-on: #18
Reviewed-by: natalie <naragon@stevens.edu>
2026-11-05 00:16:21 +00:00
Cedric PollefeysandClaude Opus 5.5 07be88a783 Release pricing v2 with a unit price of 12
seat-back-trivia/pipeline/pr-main This commit looks good
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:04:54 -05:00
3 changed files with 7 additions and 5 deletions
+2
View File
@@ -1,6 +1,8 @@
services:
app:
image: "{{ release_image }}"
# Drill only: listen on the wrong port so the health check fails.
command: ["gunicorn", "--bind", "0.0.0.0:8001", "--workers", "1", "--worker-tmp-dir", "/tmp", "app:app"]
restart: unless-stopped
read_only: true
tmpfs:
+2 -2
View File
@@ -2,8 +2,8 @@ import os
from flask import Flask, jsonify, request
app = Flask(__name__)
VERSION = "v1"
UNIT_PRICE = 10
VERSION = "v2"
UNIT_PRICE = 12
COMMIT = os.environ.get("APP_COMMIT", "development")
+3 -3
View File
@@ -7,17 +7,17 @@ class PricingTests(unittest.TestCase):
self.client = app.test_client()
def test_price(self):
self.assertEqual(total_price(3), 30)
self.assertEqual(total_price(3), 36)
response = self.client.get("/price?quantity=3")
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json["total"], 30)
self.assertEqual(response.json["total"], 36)
def test_invalid_quantity(self):
for value in ["0", "-1", "1001", "abc", "1.5"]:
self.assertEqual(self.client.get("/price?quantity=" + value).status_code, 400)
def test_release_identity(self):
self.assertEqual(self.client.get("/").json["version"], "v1")
self.assertEqual(self.client.get("/").json["version"], "v2")
self.assertEqual(self.client.get("/health").json["status"], "ok")