Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
digicosmos86 committed Jul 18, 2024
1 parent 8dc026a commit 2adec40
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion tests/simple_project.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,47 @@ run "simple_project_test" {
}

assert {
condition = simple-project.id != null
condition = output.project_id != null
error_message = "Project does not exist!"
}

assert {
condition = output.project_name == "inspec-project"
error_message = "Project name is not correct!"
}

assert {
condition = google_project.lifecycle_state == "ACTIVE"
error_message = "Project is not active"
}

assert {
condition = google_project.parent[0].type == "folder"
error_message = "Project parent type is not 'folder'"
}

assert {
condition = google_project.test_project.parent[0].id == var.folder_id
error_message = "Project parent ID does not match"
}

// assert {
// condition = length([for api in var.activated_apis : api if contains(google_project_service.test_activated_apis[*].service, api)]) == length(var.activated_apis)
// error_message = "Not all APIs are activated"
// }

// assert {
// condition = contains(google_project_iam_binding.test_logging_logWriter.members, "serviceAccount:${var.service_account_email}")
// error_message = "Logging IAM binding does not include the service account"
// }

// assert {
// condition = contains(google_project_iam_binding.test_monitoring_metricWriter.members, "serviceAccount:${var.service_account_email}")
// error_message = "Monitoring IAM binding does not include the service account"
// }

// assert {
// condition = contains(google_project_iam_binding.test_stackdriver_resourceMetadata_writer.members, "serviceAccount:${var.service_account_email}")
// error_message = "Stackdriver IAM binding does not include the service account"
// }
}

0 comments on commit 2adec40

Please sign in to comment.