From f0ccb8150a67b10e11b3358d6385e31619e6d1e3 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 26 Nov 2017 15:01:53 +0100 Subject: Update: yarn scenarios to use named pipelines --- yarns/100-projects.yarn | 105 +++++++++++------------------------------------- 1 file changed, 23 insertions(+), 82 deletions(-) (limited to 'yarns/100-projects.yarn') diff --git a/yarns/100-projects.yarn b/yarns/100-projects.yarn index aa04b7a..ba723d3 100644 --- a/yarns/100-projects.yarn +++ b/yarns/100-projects.yarn @@ -27,24 +27,9 @@ like this: { "project": "ick2-website", "pipelines": [ - { - "name": "setup-workspace", - "actions": [ - { "shell": "git clone git://git.liw.fi/ick2-website src" } - ] - }, - { - "name": "build-website", - "actions": [ - { "shell": "cd src && ikiwiki --setup ikiwiki.setup" } - ] - }, - { - "name": "publish-website", - "actions": [ - { "shell": "cd html && rsync -a --delete . server::/srv/http/ick2/." } - ] - } + "setup-workspace", + "build-website", + "publish-website" ] } @@ -63,6 +48,7 @@ building them. We start by starting an instance of the controller. SCENARIO managing projects GIVEN an RSA key pair for token signing AND an access token for user with scopes + ... uapi_pipelines_post ... uapi_projects_get ... uapi_projects_post ... uapi_projects_id_get @@ -75,34 +61,25 @@ building them. We start by starting an instance of the controller. THEN result has status code 200 AND body matches { "projects": [] } + WHEN user makes request POST /pipelines with a valid token and body + ... { + ... "name": "build", + ... "actions": [ + ... { "shell": "git clone git://repo src" }, + ... { "shell": "mkdir html" }, + ... { "shell": "ikiwiki src html" } + ... ] + ... } WHEN user makes request POST /projects with a valid token and body ... { ... "project": "website", - ... "pipelines": [ - ... { - ... "name": "build", - ... "actions": [ - ... { "shell": "git clone git://repo src" }, - ... { "shell": "mkdir html" }, - ... { "shell": "ikiwiki src html" } - ... ] - ... } - ... ] + ... "pipelines": ["build"] ... } THEN result has status code 201 AND body matches ... { ... "project": "website", - ... "pipelines": [ - ... { - ... "name": "build", - ... "actions": [ - ... { "shell": "git clone git://repo src" }, - ... { "shell": "mkdir html" }, - ... { "shell": "ikiwiki src html" } - ... ] - ... } - ... ] + ... "pipelines": ["build"] ... } AND controller state directory contains project website @@ -122,16 +99,7 @@ Creating a new project with the same name is forbidden. ... "projects": [ ... { ... "project": "website", - ... "pipelines": [ - ... { - ... "name": "build", - ... "actions": [ - ... { "shell": "git clone git://repo src" }, - ... { "shell": "mkdir html" }, - ... { "shell": "ikiwiki src html" } - ... ] - ... } - ... ] + ... "pipelines": ["build"] ... } ... ] ... } @@ -143,43 +111,22 @@ Creating a new project with the same name is forbidden. AND body matches ... { ... "project": "website", - ... "pipelines": [ - ... { - ... "name": "build", - ... "actions": [ - ... { "shell": "git clone git://repo src" }, - ... { "shell": "mkdir html" }, - ... { "shell": "ikiwiki src html" } - ... ] - ... } - ... ] + ... "pipelines": ["build"] ... } WHEN user makes request PUT /projects/website with a valid token ... and body ... { ... "project": "website", - ... "pipelines": [ - ... { - ... "name": "build", - ... "actions": [ - ... { "shell": "build-it" } - ... ] - ... } - ... ] + ... "parameters": {"foo": "bar"}, + ... "pipelines": ["build"] ... } THEN result has status code 200 AND body matches ... { ... "project": "website", - ... "pipelines": [ - ... { - ... "name": "build", - ... "actions": [ - ... { "shell": "build-it" } - ... ] - ... } - ... ] + ... "parameters": {"foo": "bar"}, + ... "pipelines": ["build"] ... } AND controller state directory contains project website @@ -188,14 +135,8 @@ Creating a new project with the same name is forbidden. AND body matches ... { ... "project": "website", - ... "pipelines": [ - ... { - ... "name": "build", - ... "actions": [ - ... { "shell": "build-it" } - ... ] - ... } - ... ] + ... "parameters": {"foo": "bar"}, + ... "pipelines": ["build"] ... } WHEN user makes request DELETE /projects/website -- cgit v1.2.1