19.1.0 • Published 8 months ago

@cumulus/integration-tests v19.1.0

Weekly downloads
83
License
Apache-2.0
Repository
github
Last release
8 months ago

@cumulus/integration-tests

This package provides a CLI and functions for testing Cumulus.

⚠️ The documented API of this package will not change without a deprecation warning being provided in earlier releases. Code in this package that is not documented in this README may change without warning, and is not considered part of the package's public API.

About Cumulus

Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.

Cumulus Documentation

Installation

$ npm install @cumulus/integration-tests

API

Modules

Collections

Example

const Collections = require('@cumulus/integration-test/Collections');

createCollection(prefix, overrides) ⇒ Promise.<Object>

Create a randomized collection using the Cumulus API.

The default collection is very simple. It expects that, for any discovered file, the granule ID is everything in the filename before the extension. For example, a file named gran-1.txt would have a granuleId of gran-1. Filenames can only contain a single . character.

Collection defaults:

  • name: random string starting with collection-name-
  • version: random string starting with collection-version-
  • reportToEms: false
  • granuleId: '^[^.]+$'
  • granuleIdExtraction: '^([^.]+)\..+$'
  • sampleFileName: 'asdf.jpg'
  • files:
    [
      {
        bucket: 'protected',
        regex: '^[^.]+\..+$',
        sampleFileName: 'asdf.jpg'
      }
    ]

Kind: Exported function
Returns: Promise.<Object> - the generated collection

ParamTypeDescription
prefixstringthe Cumulus stack name
overridesObjectproperties to set on the collection, overriding the defaults

createCollection~addCustomUrlPathToCollectionFiles(collection, customFilePath) ⇒ Array.<Object>

Given a Cumulus collection configuration, return a list of the filetype configs with their url_paths updated.

Kind: inner method of createCollection
Returns: Array.<Object> - a list of collection filetype configs

ParamTypeDescription
collectionObjecta Cumulus collection
customFilePathstringpath to be added to the end of the url_path

createCollection~buildCollection(params) ⇒ Object

Update a collection with a custom file path, duplicate handling, and name updated with the postfix.

Kind: inner method of createCollection
Returns: Object - an updated collection

ParamTypeDescription
paramsObject
params.collectionObjecta collection configuration
params.customFilePathstringpath to be added to the end of the url_path
params.duplicateHandlingstringduplicate handling setting
params.postfixstringa string to be appended to the end of the name

createCollection~collectionExists(stackName, collection) ⇒ boolean

Returns true if collection exists. False otherwise.

Kind: inner method of createCollection

ParamTypeDescription
stackNamestringthe prefix of the Cumulus stack
collectionObjecta Cumulus collection

createCollection~addCollection(stackName, collection) ⇒ Promise.<undefined>

Add a new collection to Cumulus

Kind: inner method of createCollection

ParamTypeDescription
stackNamestringthe prefix of the Cumulus stack
collectionObjecta Cumulus collection

createCollection~addCollections(stackName, bucketName, dataDirectory, postfix, customFilePath, duplicateHandling) ⇒ Promise.<Array.<Object>>

Add collections to database

Kind: inner method of createCollection
Returns: Promise.<Array.<Object>> - - collections that were added

ParamTypeDescription
stackNamestringCloud formation stack name
bucketNamestringS3 internal bucket name
dataDirectorystringthe directory of collection json files
postfixstringstring to append to collection name
customFilePathstring
duplicateHandlingstring

Executions

Example

const Executions = require('@cumulus/integration-test/Executions');

findExecutionArn(prefix, matcher, queryParameters, options) ⇒ Promise.<string>

Find the execution ARN matching the matcher function

Kind: Exported function
Returns: Promise.<string> - the ARN of the matching execution

ParamTypeDefaultDescription
prefixstringthe name of the Cumulus stack
matcherfunctiona predicate function that takes an execution and determines if this is the execution that is being searched for
queryParametersObjectOptional query parameters
optionsObject
options.timeoutinteger0the number of seconds to wait for a matching execution to be found

getExecutionWithStatus(params) ⇒ Promise.<Object>

Wait for an execution to have an expected status and return the execution

Kind: Exported function
Returns: Promise.<Object> - the execution as returned by the GET /executions/<execution-arn> endpoint

ParamTypeDefaultDescription
paramsObject
params.prefixstringthe name of the Cumulus stack
params.arnstringthe execution ARN to fetch
params.statusstringthe status to wait for
params.callbackfunctioncumulusApiClient.invokeApifunctionan async function to invoke the API Lambda that takes a prefix / user payload
params.timeoutinteger30the number of seconds to wait for the execution to reach a terminal state

Granules

Example

const Granules = require('@cumulus/integration-test/Granules');

getGranuleWithStatus(params) ⇒ Promise.<Object>

Wait for a granule to have an expected status and return the granule

Kind: Exported function
Returns: Promise.<Object> - the granule as returned by the GET /granules/<granule-id> endpoint

ParamTypeDefaultDescription
paramsObject
params.prefixstringthe name of the Cumulus stack
params.granuleIdstringthe granuleId of the granule
params.collectionIdstringthe collectionId of the granule
params.statusstringthe status to wait for
params.updatedAtstringminimum updatedAt time the granule must have to return
params.callbackfunctioncumulusApiClient.invokeApifunctionan async function to invoke the API Lambda that takes a prefix / user payload
params.timeoutinteger30the number of seconds to wait for the execution to reach a terminal state

getGranuleWithStatus~waitForListGranulesResult(params) ⇒ Promise.<Object>

Wait for listGranules to return at least a single value before returning an empty result

Kind: inner method of getGranuleWithStatus
Returns: Promise.<Object> - - results of a successful listGranules

ParamTypeDescription
paramsObjectparameters to listGranules function

Providers

Example

const Providers = require('@cumulus/integration-test/Providers');

createProvider(prefix, overrides) ⇒ Promise.<Object>

Create a provider using the Cumulus API

Provider defaults:

  • id: random string starting with provider-
  • protocol: s3
  • globalConnectionLimit: 10

Kind: Exported function
Returns: Promise.<Object> - the generated provider

ParamTypeDescription
prefixstringthe Cumulus stack name
overridesObjectproperties to set on the provider, overriding the defaults

Rules

Example

const Rules = require('@cumulus/integration-test/Rules');

createOneTimeRule(prefix, overrides) ⇒ Promise.<Object>

Create a onetime rule using the Cumulus API

Rule defaults:

  • name: random string starting with rule_
  • rule: { type: 'onetime' }

Kind: Exported function
Returns: Promise.<Object> - the generated rule

ParamTypeDescription
prefixstringthe name of the Cumulus stack
overridesObjectproperties to set on the rule, overriding the defaults

CLI Usage

Usage: cumulus-test TYPE COMMAND [options]


  Options:

    -V, --version                   output the version number
    -s, --stack-name <stackName>    AWS Cloud Formation stack name (default: null)
    -b, --bucket-name <bucketName>  AWS S3 internal bucket name (default: null)
    -w, --workflow <workflow>       Workflow name (default: null)
    -i, --input-file <inputFile>    Workflow input JSON file (default: null)
    -h, --help                      output usage information


  Commands:

    workflow  Execute a workflow and determine if the workflow completes successfully

For example, to test the HelloWorld workflow:

cumulus-test workflow --stack-name helloworld-cumulus --bucket-name cumulus-bucket-internal --workflow HelloWorldWorkflow --input-file ./helloWorldInput.json

Contributing

To make a contribution, please see our contributing guidelines.


Generated automatically using npm run build-docs

18.5.1

8 months ago

19.1.0

8 months ago

18.5.0

9 months ago

18.3.5

9 months ago

19.0.0

10 months ago

18.3.4

10 months ago

18.2.2

1 year ago

18.4.0

10 months ago

18.3.3

10 months ago

18.3.2

11 months ago

18.3.1

12 months ago

16.1.5

1 year ago

18.2.1

1 year ago

16.1.4

1 year ago

18.2.0

1 year ago

16.1.3

1 year ago

18.2.0-alpha.0

2 years ago

16.1.1

2 years ago

16.1.2

2 years ago

18.1.0

2 years ago

17.0.0

2 years ago

18.0.0

2 years ago

16.0.3-alpha.0

2 years ago

16.0.0

2 years ago

15.0.4

2 years ago

16.0.2-alpha.0

2 years ago

15.0.2

2 years ago

15.0.3

2 years ago

15.0.1

2 years ago

14.1.0

2 years ago

15.0.0

2 years ago

13.4.0

3 years ago

11.1.8

3 years ago

14.0.0

3 years ago

13.3.3-alpha.1

3 years ago

13.3.2

3 years ago

12.0.3

3 years ago

13.3.1

3 years ago

11.1.7

3 years ago

13.3.0

3 years ago

12.0.1

3 years ago

12.0.2

3 years ago

13.0.0

3 years ago

13.0.1

3 years ago

11.1.5

3 years ago

11.1.3

3 years ago

11.1.4

3 years ago

11.1.2

3 years ago

13.1.0

3 years ago

10.1.3

3 years ago

13.2.0

3 years ago

13.2.1

3 years ago

12.0.0

3 years ago

10.0.2

3 years ago

11.1.1

3 years ago

11.1.0

3 years ago

9.9.4

3 years ago

11.0.0

3 years ago

10.1.2

3 years ago

9.4.2

3 years ago

10.1.1

3 years ago

9.4.1

3 years ago

10.0.0

3 years ago

10.0.1

3 years ago

9.9.1

3 years ago

9.9.2

3 years ago

9.9.3

3 years ago

9.7.1

4 years ago

10.1.0

3 years ago

9.2.4

4 years ago

9.2.3

4 years ago

10.0.0-beta.0

4 years ago

9.9.0

4 years ago

9.8.0

4 years ago

9.8.0-alpha.0

4 years ago

9.7.0

4 years ago

9.6.0

4 years ago

9.5.0

4 years ago

9.4.0

4 years ago

9.2.2

4 years ago

8.1.2

4 years ago

9.2.1

4 years ago

9.3.0

4 years ago

9.2.0

4 years ago

8.1.1

4 years ago

9.1.0

4 years ago

8.1.0

4 years ago

9.0.1

4 years ago

9.0.0

4 years ago

8.0.0

4 years ago

6.0.1

4 years ago

7.2.0

4 years ago

7.1.0

4 years ago

7.0.0

4 years ago

6.0.0

4 years ago

5.0.1

4 years ago

5.0.0

4 years ago

4.0.0

5 years ago

3.0.1

5 years ago

2.0.8

5 years ago

3.0.0

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.24.0

5 years ago

1.23.2

5 years ago

1.23.1

5 years ago

1.23.0

5 years ago

1.22.1

5 years ago

1.22.0

5 years ago

1.21.0

5 years ago

1.20.0

5 years ago

1.19.0

5 years ago

1.18.0

5 years ago

1.17.0-alpha

5 years ago

1.17.0

5 years ago

1.14.5

5 years ago

1.16.1

6 years ago

1.16.0

6 years ago

1.15.0

6 years ago

1.13.6

6 years ago

1.14.4

6 years ago

1.14.3

6 years ago

1.14.2

6 years ago

1.14.1

6 years ago

1.13.5

6 years ago

1.14.0

6 years ago

1.13.4

6 years ago

1.13.3

6 years ago

1.13.2

6 years ago

1.13.1

6 years ago

1.13.0

6 years ago

1.12.1

6 years ago

1.12.0

6 years ago

1.11.3

6 years ago

1.11.2

6 years ago

1.11.1

7 years ago

1.11.0

7 years ago

1.10.4

7 years ago

1.10.1-1

7 years ago

1.10.3

7 years ago

1.10.2

7 years ago

1.10.1

7 years ago

1.10.0

7 years ago

1.9.1

7 years ago

1.8.4

7 years ago

1.8.3

7 years ago

1.8.2

7 years ago

1.9.0

7 years ago

1.8.1

7 years ago

1.7.1

7 years ago

1.8.0

7 years ago

1.7.0

7 years ago

1.6.0

7 years ago

1.5.5

7 years ago

1.5.4

7 years ago

1.5.3

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago