Skip to content

EndpointFunctionalTests

Tim Stair edited this page Apr 23, 2020 · 1 revision

Endpoint Functional Tests

There is a functional test of the endpoints included in the project to prove everything is deployed correctly and generally functional.

Location: /pop/endpoint/endpoint-functional-test

Prerequisites

  1. AWS Account
  2. Understanding of various AWS components and how to generally navigate the AWS console.
  3. CloudFormation stack created (/deploy/endpoint/aws/Main-AWS-CloudFormation.json)
  4. IntelliJ IDEA

Setup

Create Test SQS

  1. In the AWS Console (or otherwise) please create a standard SQS named:

POP-Test-Queue

Create Data Objects

These test object json objects are ready to be copy and pasted into the associated DynamoDB tables.

⚠️ The ids in these are not random. They are pre-configured in the test.properties for convenience.

ResourcePool

{
  "customerId": "account/2707862",
  "id": "599f2241-3877-4301-b3d2-aa7e4274e42a",
  "title": "POPPool-Test-Pool"
}

Customer

{
  "customerId": "account/3131523765",
  "id": "account/3131523765",
  "resourcePoolId": "599f2241-3877-4301-b3d2-aa7e4274e42a",
  "title": "TestAccount"
}

Insight

Please paste this as DynamoDB Json (checkbox).

{
  "customerId": {
    "S": "account/3131523765"
  },
  "global": {
    "BOOL": false
  },
  "id": {
    "S": "547cc659-f7a3-4fbe-b171-a2d0ad355b4d"
  },
  "isGlobal": {
    "N": "0"
  },
  "mappers": {
    "M": {
      "operationType": {
        "SS": [
          "testOperation"
        ]
      }
    }
  },
  "queueName": {
    "S": "POP-Test-Queue"
  },
  "queueSize": {
    "N": "1"
  },
  "resourcePoolId": {
    "S": "599f2241-3877-4301-b3d2-aa7e4274e42a"
  },
  "schedulingAlgorithm": {
    "S": "FirstInFirstOut"
  },
  "title": {
    "S": "POP-Test-Insight"
  }
}

Adjust test.properties

  • Change this line: endpoint.url=https://<your aws url here>/dev to use the URL of the API Gateway generated by your stack creation.

Execution

  1. Load IDEA
  2. Navigate to /endpoint/endpoint-functional-test/testng-functional.xml
  3. Open the context menu on the file and select Run.

Priority Operation Processing

  1. Submission
  2. Scheduling
  3. Execution
    the ResourcePool

Data Object API

Agenda
the workflow
Agenda Template
the workflow definition
Customer
Insight
the scheduling queue definition
Operation Progress
the state of the running Agenda operations
Progress
the state of the running Agendas
ResourcePool
the processing resources

Service Agenda

Agenda Service
the workflow submission
Progress Service
rolled up agenda progress summary
ResourcePool Service
getting work and updating progress

Timed Processes

AgendaReclaimer
restarting stuck Agendas
AgendaRetry
retrying failed Agendas
DataObjectReaper
reaping expired data objects
PodReaper
reaping stuck Kubernetes pods

Installation

Install

Development

DevKubernetesSetup
RunLocalExecution
- RunWithMiniKube

Demo / Examples

SampleAuthorizer
SampleHandler

Clone this wiki locally