Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init testing #125

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
}
Loading