Compare commits

..
Author SHA1 Message Date
nkogut 4d7e4f932f Set release intent to v2
myfileagent-python-ci/pipeline/head This commit looks good
myfileagent-python-ci/pipeline/pr-main This commit looks good
2026-11-07 22:49:35 +00:00
nkogut 699d509024 Update tests for v2 pricing
myfileagent-python-ci/pipeline/head Build queued...
2026-11-07 22:49:16 +00:00
nkogut 126dbb00b3 Prepare v2 pricing source
myfileagent-python-ci/pipeline/head This commit looks good
2026-11-07 22:48:53 +00:00
glovely 0cb5a34cc4 Merge pull request 'Allow staging health checks more time under load' (#19) from assignment8/healthcheck-review into main
myfileagent-python-ci/pipeline/head This commit looks good
Team manual PDF / manual (push) Successful in 2m52s
Reviewed-on: #19
Reviewed-by: glovely <glovely@stevens.edu>
2026-11-07 22:30:51 +00:00
nkogut 746b42b72b Allow staging health checks more time under load
myfileagent-python-ci/pipeline/pr-main This commit looks good
myfileagent-python-ci/pipeline/head This commit looks good
2026-11-07 22:28:21 +00:00
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
{"version": "v1", "quantity3_total": 30}
{"version": "v2", "quantity3_total": 36}
+1 -1
View File
@@ -8,5 +8,5 @@ RUN python -m pip uninstall -y pip && rm -rf /usr/local/lib/python3.13/ensurepip
COPY app.py .
USER 10001:10001
EXPOSE 8000
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2)"
HEALTHCHECK --interval=10s --timeout=10s --start-period=10s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=8)"
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "1", "--worker-tmp-dir", "/tmp", "app:app"]
+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")