summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-04-30 17:24:27 +0300
committerLars Wirzenius <liw@liw.fi>2018-06-10 19:44:48 +0300
commitfd3fd66a1db8925e5a9a3d34acdd213f49378877 (patch)
tree5246b011f1cd035417fbca0a361b78fc630b2317 /yarns
parent9759c2b51a1250aa345c21b7cc6b793f4965ac2d (diff)
downloadick2-fd3fd66a1db8925e5a9a3d34acdd213f49378877.tar.gz
Add: notification service
Diffstat (limited to 'yarns')
-rw-r--r--yarns/100-projects.yarn1
-rw-r--r--yarns/150-pipelines.yarn1
-rw-r--r--yarns/200-version.yarn2
-rw-r--r--yarns/300-workers.yarn1
-rw-r--r--yarns/400-build.yarn3
-rw-r--r--yarns/500-build-fail.yarn1
-rw-r--r--yarns/600-unauthz.yarn1
-rw-r--r--yarns/900-local.yarn14
8 files changed, 24 insertions, 0 deletions
diff --git a/yarns/100-projects.yarn b/yarns/100-projects.yarn
index c5052f9..2fddded 100644
--- a/yarns/100-projects.yarn
+++ b/yarns/100-projects.yarn
@@ -57,6 +57,7 @@ building them. We start by starting an instance of the controller.
AND controller config uses statedir at the state directory
AND controller config uses https://blobs.example.com as artifact store
AND controller config uses https://auth.example.com as authentication
+ AND controller config uses https://notify.example.com as notify
AND a running ick controller
WHEN user makes request GET /projects
diff --git a/yarns/150-pipelines.yarn b/yarns/150-pipelines.yarn
index a63ce02..e2416a8 100644
--- a/yarns/150-pipelines.yarn
+++ b/yarns/150-pipelines.yarn
@@ -68,6 +68,7 @@ running them. We start by starting an instance of the controller.
AND controller config uses statedir at the state directory
AND controller config uses https://blobs.example.com as artifact store
AND controller config uses https://auth.example.com as authentication
+ AND controller config uses https://notify.example.com as notify
AND a running ick controller
WHEN user makes request GET /pipelines
diff --git a/yarns/200-version.yarn b/yarns/200-version.yarn
index 8d8078d..710a57a 100644
--- a/yarns/200-version.yarn
+++ b/yarns/200-version.yarn
@@ -28,6 +28,7 @@ The Ick controller reports is version upon request.
AND controller config uses statedir at the state directory
AND controller config uses https://blobs.example.com as artifact store
AND controller config uses https://auth.example.com as authentication
+ AND controller config uses https://notify.example.com as notify
AND a running ick controller
WHEN user makes request GET /version
@@ -35,6 +36,7 @@ The Ick controller reports is version upon request.
AND version in body matches version from setup.py
AND artifact store URL is https://blobs.example.com
AND authentication URL is https://auth.example.com
+ AND notify URL is https://notify.example.com
FINALLY stop ick controller
diff --git a/yarns/300-workers.yarn b/yarns/300-workers.yarn
index 89444f9..6399b20 100644
--- a/yarns/300-workers.yarn
+++ b/yarns/300-workers.yarn
@@ -63,6 +63,7 @@ controller API. It doesn't actually talk to the worker itself.
AND controller config uses statedir at the state directory
AND controller config uses https://blobs.example.com as artifact store
AND controller config uses https://auth.example.com as authentication
+ AND controller config uses https://notify.example.com as notify
AND a running ick controller
WHEN user makes request GET /workers
diff --git a/yarns/400-build.yarn b/yarns/400-build.yarn
index 1674189..cef92e9 100644
--- a/yarns/400-build.yarn
+++ b/yarns/400-build.yarn
@@ -29,6 +29,7 @@ Set up the controller.
AND controller config uses statedir at the state directory
AND controller config uses https://blobs.example.com as artifact store
AND controller config uses https://auth.example.com as authentication
+ AND controller config uses https://notify.example.com as notify
AND an access token for user with scopes
... uapi_pipelines_post
... uapi_projects_post
@@ -820,6 +821,7 @@ Set up the controller.
AND controller config uses statedir at the state directory
AND controller config uses https://blobs.example.com as artifact store
AND controller config uses https://auth.example.com as authentication
+ AND controller config uses https://notify.example.com as notify
AND an access token for user with scopes
... uapi_pipelines_post
... uapi_projects_post
@@ -1027,6 +1029,7 @@ Set up the controller.
AND controller config uses statedir at the state directory
AND controller config uses https://blobs.example.com as artifact store
AND controller config uses https://auth.example.com as authentication
+ AND controller config uses https://notify.example.com as notify
AND an access token for user with scopes
... uapi_pipelines_post
... uapi_projects_post
diff --git a/yarns/500-build-fail.yarn b/yarns/500-build-fail.yarn
index 204bfd5..3373c2f 100644
--- a/yarns/500-build-fail.yarn
+++ b/yarns/500-build-fail.yarn
@@ -30,6 +30,7 @@ Set up the controller.
AND controller config uses statedir at the state directory
AND controller config uses https://blobs.example.com as artifact store
AND controller config uses https://auth.example.com as authentication
+ AND controller config uses https://notify.example.com as notify
AND an access token for user with scopes
... uapi_pipelines_post
... uapi_projects_post
diff --git a/yarns/600-unauthz.yarn b/yarns/600-unauthz.yarn
index c656f0e..1c928ac 100644
--- a/yarns/600-unauthz.yarn
+++ b/yarns/600-unauthz.yarn
@@ -30,6 +30,7 @@ Set up the controller.
AND controller config uses statedir at the state directory
AND controller config uses https://blobs.example.com as artifact store
AND controller config uses https://auth.example.com as authentication
+ AND controller config uses https://notify.example.com as notify
AND an access token for user with scopes
... uapi_projects_post
... uapi_projects_id_status_put
diff --git a/yarns/900-local.yarn b/yarns/900-local.yarn
index 40bf762..1318eb9 100644
--- a/yarns/900-local.yarn
+++ b/yarns/900-local.yarn
@@ -53,6 +53,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
IMPLEMENTS GIVEN controller config uses (\S+) as authentication
vars['auth_url'] = get_next_match()
+ IMPLEMENTS GIVEN controller config uses (\S+) as notify
+ vars['notify_url'] = get_next_match()
+ assert vars['notify_url'] is not None
+
## Start and stop the controller
IMPLEMENTS GIVEN a running ick controller
@@ -62,6 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
vars['port'] = random_free_port()
vars['url'] = 'http://127.0.0.1:{}'.format(vars['port'])
assert vars['auth_url'] is not None
+ assert vars['notify_url'] is not None
config = {
'token-issuer': vars['issuer'],
'token-audience': vars['audience'],
@@ -74,7 +79,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
'statedir': vars['statedir'],
'artifact-store': vars['artifact_store'],
'auth-url': vars['auth_url'],
+ 'notify-url': vars['notify_url'],
}
+ assert config['notify-url'] is not None
env = dict(os.environ)
env['ICK_CONTROLLER_CONFIG'] = 'ick_controller.yaml'
yaml.safe_dump(config, open('ick_controller.yaml', 'w'))
@@ -131,6 +138,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
actual = obj['auth_url']
assertEqual(actual, expected)
+ IMPLEMENTS THEN notify URL is (\S+)
+ expected = get_next_match()
+ body = vars['body']
+ obj = json.loads(body)
+ actual = obj['notify_url']
+ assertEqual(actual, expected)
+
## Start and stop artifact store
IMPLEMENTS GIVEN artifact store config uses (\S+) at the blob directory