oci-quickstart icon indicating copy to clipboard operation
oci-quickstart copied to clipboard

Add ORM test

Open cpoczatek opened this issue 5 years ago • 0 comments

Terratest check the correctness of the terraform itself, but the correctness of the .zip in the ORM stack isn't tested. Build script could contain an error or zip could be malformed.

There isn't a terraform resource for ORM stacks (ouroboros) so we'd have to use the oci CLI or make api calls. CLI would be simpler but requires install/config.

Eg:

oci resource-manager stack create --compartment-id $TF_VAR_compartment_ocid \
>  --config-source ./marketplace.zip \
>  --display-name cli-test \
>  --terraform-version 0.12.x
{
  "data": {
    "compartment-id": "ocid1.compartment.oc1..aaaaaaaauc4ys2qb3h3ysdehgo6pqk3tryse53rhl6jnekypzryn246v6xyq",
    "config-source": {
      "config-source-type": "ZIP_UPLOAD",
      "working-directory": null
    },
    "defined-tags": {
      "Oracle-Tags": {
        "CreatedBy": "oracleidentitycloudservice/[email protected]",
        "CreatedOn": "2020-04-20T23:06:56.599Z"
      }
    },
    "description": null,
    "display-name": "cli-test",
    "freeform-tags": {},
    "id": "ocid1.ormstack.oc1.iad.aaaaaaaa23znfmdcs3q4xd7j3m7enobsj5q46v3seuzbxk7pibcj4jyo27bq",
    "lifecycle-state": "ACTIVE",
    "terraform-version": "0.12.x",
    "time-created": "2020-04-20T23:06:56.741000+00:00",
    "variables": {}
  },
  "etag": "e29d25e11277585218825cb881f8857fc966bfd97f41a87b08fd4ed6dbf4ab90"
}

Need additional calls for job creation, and from the doc it appears to be able to block and wait on job success.

cpoczatek avatar Apr 21 '20 05:04 cpoczatek