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

Fix tests #48

Merged
merged 1 commit into from
Jul 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
5 changes: 1 addition & 4 deletions .github/workflows/gotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

name: Test

on:
push:
branches:
- "*"
on: pull_request

jobs:

Expand Down
9 changes: 6 additions & 3 deletions internal/provider/appstoreapp_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ func TestAccAppStoreAppResource(t *testing.T) {
{
Config: providerConfig() + fmt.Sprintf(`
resource "lumos_app" "test_app" {
name = "Terraform Testing - Appstore app"
description = "Terraform Testing Description"
category = "Developers"
name = "Terraform Testing - Appstore app"
description = "Terraform Testing Description"
category = "Developers"
website_url = "https://www.example.com"
logo_url = "https://www.example.com/logo.png"
request_instructions = "Custom request instructions"
}
resource "lumos_app_store_app" "test_app_store_app" {
app_id = lumos_app.test_app.id
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/appstoreappsettings_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccAppStoreAppSettingsResource(t *testing.T) {
func TestAccAppStoreAppSettingsDataSource(t *testing.T) {
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
Expand Down
12 changes: 12 additions & 0 deletions tests/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,15 @@ func TestGetApp(t *testing.T) {
t.Fatalf(`client.AppStore.GetAppStoreApp(%s) = %v, %v`, appId, response, err)
}
}

func TestCreateApp(t *testing.T) {
client, ctx := GetNewClient(t)
response, err := client.Core.CreateApp(ctx, shared.AppInputCreate{
Name: "Terraform Testing - Create app",
Description: "Terraform Testing Description",
Category: "Developers",
})
if err != nil || response == nil {
t.Fatalf(`client.Core.CreateApp() was unsuccessful, %v, %v`, response, err)
}
}