Skip to content

Commit

Permalink
fix: Init resource tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adityachoudhari26 committed Jan 30, 2025
1 parent 0d74259 commit 092a971
Show file tree
Hide file tree
Showing 23 changed files with 141 additions and 608 deletions.
8 changes: 7 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@ test:
testacc:
TF_ACC=1 go test -v -cover -timeout 120m ./...

.PHONY: fmt lint test testacc build install generate
test-acceptance:
TF_ACC=1 \
CTRLPLANE_TOKEN=$(CTRLPLANE_PROVIDER_TESTING_API_KEY) \
CTRLPLANE_WORKSPACE=$(CTRLPLANE_PROVIDER_TESTING_WORKSPACE) \
go test -v -cover -timeout 120m ./...

.PHONY: fmt lint test testacc build install generate
3 changes: 3 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package client

//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config openapi.client.yaml openapi.v1.yaml
3 changes: 3 additions & 0 deletions client/openapi.client.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json
package: client
output: client.gen.go
Expand Down
3 changes: 3 additions & 0 deletions client/openapi.generate.sh
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

oapi-codegen -config openapi.client.yaml https://raw.githubusercontent.com/ctrlplanedev/ctrlplane/refs/heads/main/openapi.v1.json
3 changes: 3 additions & 0 deletions client/openapi.v1.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

openapi: 3.0.0
info:
title: Ctrlplane API
Expand Down
3 changes: 3 additions & 0 deletions docker_compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

version: "3.7"
services:
api:
Expand Down
30 changes: 0 additions & 30 deletions docs/data-sources/example.md

This file was deleted.

26 changes: 0 additions & 26 deletions docs/functions/example.md

This file was deleted.

17 changes: 14 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@ description: |-
## Example Usage

```terraform
provider "scaffolding" {
# example configuration here
terraform {
required_providers {
ctrlplane = {
source = "ctrlplane/ctrlplane"
}
}
}
provider "ctrlplane" {
base_url = "http://localhost:3000"
workspace = "ctrlplane"
}
```

Expand All @@ -23,4 +32,6 @@ provider "scaffolding" {

### Optional

- `endpoint` (String) Example provider attribute
- `base_url` (String) The URL of the Ctrlplane API endpoint
- `token` (String) The token to use for authentication
- `workspace` (String) The workspace to use
5 changes: 5 additions & 0 deletions docs/resources/ctrlplane_system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "<no value> <no value> - <no value>"
subcategory: ""
description: |-
31 changes: 0 additions & 31 deletions docs/resources/example.md

This file was deleted.

3 changes: 3 additions & 0 deletions internal/provider/data_source_model.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package provider

import (
Expand Down
105 changes: 0 additions & 105 deletions internal/provider/example_data_source.go

This file was deleted.

32 changes: 0 additions & 32 deletions internal/provider/example_data_source_test.go

This file was deleted.

50 changes: 0 additions & 50 deletions internal/provider/example_function.go

This file was deleted.

Loading

0 comments on commit 092a971

Please sign in to comment.