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

Added bootstrap commands & reusable acc test workflow #47

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

maxcoulombe
Copy link
Contributor

@maxcoulombe maxcoulombe commented Oct 23, 2023

Overview

Added reusable workflow for acc tests

Development flow becomes:

  • make setup-env
  • source ./bootstrap/terraform/local_environment_setup.sh
  • Code your feature or bug fix
  • make configure
  • Test your modifications through vault commands or run the acceptance tests with make acctest
  • You can quickly iterate by running make configure after any code modification to update your local Vault instance with the latest changes

Full run:

user:~/projects/vault-plugin-database-redis$ make setup-env
(...)
Terraform has been successfully initialized!
(...)
Apply complete! Resources: 3 added, 0 changed, 0 destroyed.

user:~/projects/vault-plugin-database-redis$ source ./bootstrap/terraform/local_environment_setup.sh
user:~/projects/vault-plugin-database-redis$ make configure
CGO_ENABLED=0 go build -o bin/vault-plugin-database-redis cmd/vault-plugin-database-redis/main.go
Success! Deregistered plugin (if it was registered): vault-plugin-database-redis
Success! Disabled the secrets engine (if it existed) at: database/
vault-plugin-database-redis: no process found
Success! Enabled the database secrets engine at: database/
Success! Registered plugin: vault-plugin-database-redis
Success! Data written to: database/config/local-redis
Success! Data written to: database/roles/my-dynamic-role
Key                Value
---                -----
lease_id           database/creds/my-dynamic-role/<UUID>
lease_duration     5m
lease_renewable    true
password           <password>
username           <username>

user:~/projects/vault-plugin-database-redis$ make testacc
==> Checking that code complies with gofumpt requirements...
(...)
ok  	github.com/hashicorp/vault-plugin-database-redis	4.996s

user:~/projects/vault-plugin-database-redis$ make teardown-env
(...)
Terraform has been successfully initialized!
(...)
Destroy complete! Resources: 3 destroyed.

Contributor Checklist

  • [-] Add relevant docs to upstream Vault repository, or sufficient reasoning why docs won’t be added yet
  • Add output for any tests not ran in CI to the PR description (eg, acceptance tests)
  • Backwards compatible

+ added reusable workflow for acc tests
* bumped go


* bumped acctest workflow version


* fix terraform project


* adjust docker compose file


* fix username


* edit readme
Copy link
Contributor

@Zlaticanin Zlaticanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@maxcoulombe maxcoulombe merged commit 64231a6 into main Oct 24, 2023
5 checks passed
@maxcoulombe maxcoulombe deleted the max/bootstrap-commands branch October 24, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants