feat: update Dockerfile and Makefile for improved deployment; add integration testing instructions and version endpoint
All checks were successful
Build and Push to Private Registry101 / build (push) Successful in 33s

This commit is contained in:
stephen schuresko
2025-02-18 08:29:31 -05:00
parent 40eda9f021
commit b9bf105939
9 changed files with 143 additions and 14 deletions

85
integration.pyrest.yaml Normal file
View File

@@ -0,0 +1,85 @@
# Test using included Django test app
# First install python-django
# Then launch the app in another terminal by doing
# cd testapp
# python manage.py testserver test_data.json
# Once launched, tests can be executed via:
# python resttest.py http://localhost:8000 miniapp-test.yaml
---
- config:
- testset: "Tests using test app"
- variable_binds:
- 'uid': 1
- 'post_id': 1
- test: # create entity
- name: "Basic get"
- url: "/"
- test: # create entity
- name: "Get version"
- url: "/version"
- test: # create person by POST
- name: "Create person"
- url: "/users"
- method: "POST"
- body: '{"name": "Willim","email": "theadmiral@gmail.com"}'
- headers: {Content-Type: application/json}
- extract_binds:
- 'uid' : {'jsonpath_mini': "user.id"}
- test: # get single person
- name: "Get single person"
- url: {'template':'/users/$uid'} # use binded value
- method: 'GET'
- test: # update person by PUT
- name: "update person by PUT"
- url: {'template':'/users/$uid'}
- method: "PUT"
- body: '{"name": "Gaius"}'
- headers: {'Content-Type': 'application/json'}
- test: # create post by POST
- name: "Create post"
- url: "/posts"
- method: "POST"
- body: '{"title": "Willims post","content": "william made a post","author_id": 1}'
- headers: {Content-Type: application/json}
- extract_binds:
- 'post_id' : {'jsonpath_mini': "post.id"}
- test: # get single post
- name: "Get single post"
- url: {'template':'/posts/$post_id'}
- method: 'GET'
- test: # update post by PUT
- name: "update post by PUT"
- url: {'template':'/posts/$post_id'}
- method: "PUT"
- body: '{"title": "Gaius made a post"}'
- headers: {'Content-Type': 'application/json'}
- test: # delete post
- name: "Delete post"
- url: {'template':'/posts/$post_id'}
- method: "DELETE"
- test: # delete person
- name: "Delete person"
- url: {'template':'/users/$uid'}
- method: "DELETE"