Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevcube committed May 16, 2024
1 parent 06045c4 commit dc17aeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 54 deletions.
59 changes: 9 additions & 50 deletions test/unit-complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module "repository" {
name = var.name
description = var.description
homepage_url = var.url
private = false
visibility = "public"
has_issues = var.has_issues
has_projects = var.has_projects
has_wiki = var.has_wiki
Expand All @@ -42,22 +42,17 @@ module "repository" {
allow_auto_merge = var.allow_auto_merge
delete_branch_on_merge = var.delete_branch_on_merge
is_template = var.is_template
has_downloads = var.has_downloads
auto_init = var.auto_init
gitignore_template = var.gitignore_template
license_template = var.license_template
archived = false
topics = var.topics
archive_on_destroy = false

branches = [
{
name = "develop"
},
{
name = "staging"
},
]
branches = {
develop = {},
staging = {},
}

admin_collaborators = ["kevcube"]

Expand Down Expand Up @@ -87,9 +82,8 @@ module "repository" {
secret = var.webhook_secret
}]

branch_protections_v4 = [
{
pattern = "staging"
branch_protections = {
staging = {

allows_deletions = false
allows_force_pushes = false
Expand All @@ -109,39 +103,7 @@ module "repository" {
strict = true
}
}
]

branch_protections_v3 = [
{
branch = "main"
enforce_admins = true
require_conversation_resolution = true
require_signed_commits = true

required_status_checks = {
strict = true
checks = ["ci/travis"]
}

required_pull_request_reviews = {
dismiss_stale_reviews = true
dismissal_users = [var.team_user]
dismissal_teams = [github_team.team.name]
require_code_owner_reviews = true
required_approving_review_count = 1
}

restrictions = {
users = [var.team_user]
teams = [github_team.team.name]
}
},
{
branch = "develop"
enforce_admins = true
require_signed_commits = true
}
]
}

issue_labels = var.issue_labels

Expand Down Expand Up @@ -172,13 +134,10 @@ module "repository-with-defaults" {

name = var.repository_with_defaults_name
description = var.repository_with_defaults_description
defaults = var.repository_defaults
default_branch = "development"
archive_on_destroy = false

branches = [
{ name = "development" },
]
branches = { development = {} }
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions test/unit-complete/provider.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
provider "github" {
owner = "kbc-trading"
}
provider "github" {}

terraform {
required_version = "~> 1.0"
Expand All @@ -9,7 +7,7 @@ terraform {
github = {
source = "integrations/github"
# mask providers with broken branch protection v3 imlementation
version = "~> 5.0, !=5.3.0, !=5.4.0, !=5.5.0, !=5.6.0, !=5.7.0"
version = "~> 6"
}
tls = {
source = "hashicorp/tls"
Expand Down

0 comments on commit dc17aeb

Please sign in to comment.