Skip to content

Commit

Permalink
init testing (#125)
Browse files Browse the repository at this point in the history
* init testing

* set branch
  • Loading branch information
jsbroks authored May 29, 2024
1 parent a617851 commit 2eef768
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/handler-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@ on:

env:
GOOGLE_SERVICE_ACCOUNT: "terraform-google-testing@playground-111.iam.gserviceaccount.com"
TFE_TOKEN: ${{ secrets.TFE_TOKEN }}

jobs:
public-dns-with-cloud-dns:
name: Public DNS with Cloud DNS
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./tests/public-dns

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.sha }}
persist-credentials: false

- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
Expand Down Expand Up @@ -48,6 +57,10 @@ jobs:
id: validate
run: terraform validate -no-color

- name: Terraform Apply
id: apply
run: terraform apply -auto-approve -input=false -no-color

- name: Retrieve Health Check URL
id: retrieve-health-check-url
run: |
Expand Down
11 changes: 11 additions & 0 deletions tests/public-dns/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# TEST: Public DNS deployment of W&B

## About This Test

## Prerequisites

## How This Test Is Used

This test is leveraged by this repository's continuous integration setup which
leverages workspaces in a Terraform Cloud workspaces as a remote backend so that
Terraform state is preserved.
52 changes: 52 additions & 0 deletions tests/public-dns/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
provider "google" {
default_labels = local.labels
}

provider "google-beta" {
default_labels = local.labels
}

resource "random_pet" "main" {
length = 1
prefix = "tgw-pd"
separator = "-"
}

variable "license" {
type = string
}

locals {
labels = {
oktodelete = "true"
department = "engineering"
product = "server"
repository = "terraform-google-wandb"
description = "public-dns"
environment = "test"
}
}

module "wandb" {
source = "../../"

namespace = random_pet.main.id
subdomain = random_pet.main.id
license = var.license
domain_name = "wandb.ml"

create_redis = true
use_internal_queue = true

deletion_protection = false

labels = local.labels
}

output "url" {
value = module.wandb.url
}

output "health_check_url" {
value = "${module.wandb.url}/health"
}
11 changes: 11 additions & 0 deletions tests/public-dns/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {
required_version = ">= 0.14"

cloud {
organization = "weights-and-biases"

workspaces {
name = "terraform-google-wandb-public-dns"
}
}
}

0 comments on commit 2eef768

Please sign in to comment.