Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
anvial committed Mar 29, 2024
1 parent 2a30ac9 commit d88eee9
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions internal/juju/secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,59 @@ func (s *UserSecretSuite) setupMocks(t *testing.T) *gomock.Controller {
s.mockConnection = NewMockConnection(ctlr)
s.mockConnection.EXPECT().Close().Return(nil).AnyTimes()

// TODO: Need to add all resources from the following plan, ad then is this Mocked TF state in tests:
// ```
//terraform {
// required_providers {
// juju = {
// source = "juju/juju"
// version = "0.11.0"
// }
// }
//}
//
//provider "juju" {}
//
//resource "juju_model" "my_model" {
// name = "tf-secret-test"
//}
//
//resource "juju_application" "githubrunner" {
// name = "github-runner"
// model = juju_model.my_model.name
//
// charm {
// name = "github-runner"
// revision = 96
// channel = "latest/edge"
// }
//
// config = {
// runner-storage = "runner-storage-value"
// }
//
// units = 1
//}
//
//resource "juju_secret" "my_secret" {
// model = juju_model.my_model.name
// name = "my_secret_name"
// value = {
// key1 = "value1"
// key2 = "value2"
// }
// info = "This is my secret"
//}
//
//resource "juju_access_secret" "my_secret_access" {
// model = juju_model.my_model.name
// applications = [
// juju_application.githubrunner
// ]
// secret_id = juju_secret.my_secret.secret_id
//}
// ```

s.mockResourceAPIClient = NewMockResourceAPIClient(ctlr)
s.mockResourceAPIClient.EXPECT().ListResources(gomock.Any()).DoAndReturn(
func(applications []string) ([]resources.ApplicationResources, error) {
Expand Down

0 comments on commit d88eee9

Please sign in to comment.