Skip to content

Commit

Permalink
added more DS features, ADE catalog feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-gangl committed Mar 15, 2022
1 parent f118050 commit 22ca1b1
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 5 deletions.
30 changes: 30 additions & 0 deletions features/ade/catalog.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Feature: Algorithm Catalog system tests

Scenario: Algorithm Packages can be registered in the catalog
Given an algorithm binary in an accessible repository
And an algorithm descriptor
When the algorithm descriptor is registered in the Algorithm Catalog
Then the algorithm is searchable in the Algorithm catalog
And the search result maps back to the algorithm binary

Scenario: Search the catalog for an algorithm package
Given a set of catalog algorithms
| name | binary |
| algo1 | https://algo1.com |
| algo2 | https://algo2.com |
| algo3 | https://algo3.com |
And the catalog algorithms are registered in the Algorithm Catalog
When a user searches the algorithm catalog
Then the search retrieves 3 results

Scenario: Access an algorithm package from a catalog result
Given a set of catalog algorthms
| name | binary |
| algo1 | https://algo1.com |
| algo2 | https://algo2.com |
| algo3 | https://algo3.com |
And the catalog algorithms are registered in the Algorithm Catalog
When a user searches the algorithm catalog by name
Then the user gets the algorithm package back
And the algorithm package references the correct binary
And the binary is accessible
24 changes: 24 additions & 0 deletions features/ds/ingest-data.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Feature: Ingest (copy and catalog) Data in S3 with the U-DS Catalog
This test will register a product (one or more files) with the U-DS catalog based on the
implementation standards documented in the unity architecture. There will be
no mention of 'cumulus' or 'cmr' or other underlying implementations

Scenario: Ingest SounderSIPS data
Given SounderSIPS data exists at an accessible location
But the data are not in a Unity owned bucket
And a collection has been created for this product
And a CNM has been created for the product
When a CNM request is sent to the ingest endpoint
Then the product shall be copied to a Unity owned bucket
Then the product should be searchable in the catalog
And the search result maps to the new file

Scenario: User Provided file
Given a registered user
And a data product to upload
And a collection has been created for this product
When a user uploads the product
Then the product shall be copied to a Unity owned bucket
Then the product should be searchable in the catalog
And the search result maps to the new file
And the search result maps to a collection
8 changes: 4 additions & 4 deletions features/ds/register-data.feature
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
Feature: Register Data in S3 with the U-DS Catalog
Feature: Register (catalog) Data in S3 with the U-DS Catalog
This test will register a product (one or more files) with the U-DS catalog based on the
implementation standards documented in the unity architecture. There will be
no mention of 'cumulus' or 'cmr' or other underlying implementations

Scenario: Register a file on disk into a known collection
Given a product exists in an S3 bucket
And a collection has been created for this filetype
And a collection has been created for this product
And a CNM has been created for the product
When a CNM request is sent to the ingest endpoint
Then the product should be searchable in the catalog
And the file maps back to the original file

Scenario: Register a file on disk with mal-formed CNM
Given a product exists in an S3 bucket
And a collection has been created for this filetype
And a collection has been created for this product
And an invalid CNM has been created for the product
When a CNM request is sent to the ingest endpoint
Then the product should not be searchable in the catalog
And a error message has been added to the queue

Scenario: Register a non-existent file on disk
Given a collection has been created for this filetype
Given a collection has been created for this product
And a CNM has been created for the product
But the CNM message references a non-existent object
When a CNM request is sent to the ingest endpoint
Expand Down
76 changes: 76 additions & 0 deletions features/steps/ade/steps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
from behave import *
from behave.runner import Context

import json

@given(u'an algorithm binary in an accessible repository')
def step_impl(context):
raise NotImplementedError(u'STEP: Given an algorithm binary in an accessible repository')


@given(u'an algorithm descriptor')
def step_impl(context):
raise NotImplementedError(u'STEP: Given an algorithm descriptor')


@when(u'the algorithm descriptor is registered in the Algorithm Catalog')
def step_impl(context):
raise NotImplementedError(u'STEP: When the algorithm descriptor is registered in the Algorithm Catalog')


@then(u'the algorithm is searchable in the Algorithm catalog')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the algorithm is searchable in the Algorithm catalog')


@then(u'the search result maps back to the algorithm binary')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the search result maps back to the algorithm binary')


@given(u'a set of catalog algorithms')
def step_impl(context):
for row in context.table:
print(row['name'])
print(row['binary'])
raise NotImplementedError(u'STEP: Given a set of catalog algorithms')


@given(u'the catalog algorithms are registered in the Algorithm Catalog')
def step_impl(context):
raise NotImplementedError(u'STEP: Given the catalog algorithms are registered in the Algorithm Catalog')


@when(u'a user searches the algorithm catalog')
def step_impl(context):
raise NotImplementedError(u'STEP: When a user searches the algorithm catalog')


@then(u'the search retrieves 3 results')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the search retrieves 3 results')


@given(u'a set of catalog algorthms')
def step_impl(context):
raise NotImplementedError(u'STEP: Given a set of catalog algorthms')


@when(u'a user searches the algorithm catalog by name')
def step_impl(context):
raise NotImplementedError(u'STEP: When a user searches the algorithm catalog by name')


@then(u'the user gets the algorithm package back')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the user gets the algorithm package back')


@then(u'the algorithm package references the correct binary')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the algorithm package references the correct binary')


@then(u'the binary is accessible')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the binary is accessible')
48 changes: 47 additions & 1 deletion features/steps/ds/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def step_impl(context:Context):
raise NotImplementedError(u'a product exists in an S3 bucket')

@given(u'a collection has been created for this filetype')
@given(u'And a collection has been created for this product')
def step_impl(context):
raise NotImplementedError(u'STEP: Given a collection has been created for this filetype')

Expand Down Expand Up @@ -60,3 +60,49 @@ def step_impl(context):
@then(u'the file size matches the CNM file size')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the file size matches the CNM file size')

# new additions#

@given(u'SounderSIPS data exists at an accessible location')
def step_impl(context):
raise NotImplementedError(u'STEP: Given SounderSIPS data exists at an accessible location')


@given(u'the data are not in a Unity owned bucket')
def step_impl(context):
raise NotImplementedError(u'STEP: Given the data are not in a Unity owned bucket')


@given(u'a collection has been created for this product')
def step_impl(context):
raise NotImplementedError(u'STEP: Given a collection has been created for this product')


@then(u'the product shall be copied to a Unity owned bucket')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the product shall be copied to a Unity owned bucket')


@then(u'the search result maps to the new file')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the search result maps to the new file')


@given(u'a registered user')
def step_impl(context):
raise NotImplementedError(u'STEP: Given a registered user')


@given(u'a data product to upload')
def step_impl(context):
raise NotImplementedError(u'STEP: Given a data product to upload')


@when(u'a user uploads the product')
def step_impl(context):
raise NotImplementedError(u'STEP: When a user uploads the product')


@then(u'the search result maps to a collection')
def step_impl(context):
raise NotImplementedError(u'STEP: Then the search result maps to a collection')
1 change: 1 addition & 0 deletions features/steps/import_steps.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Cumulus steps
from features.steps.ds.steps import *
from features.steps.ade.steps import *

0 comments on commit 22ca1b1

Please sign in to comment.