Skip to content

Commit

Permalink
test: Add test for the example provider (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo authored Mar 21, 2024
2 parents f833712 + 9e70942 commit d9768d7
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ target
.nix-gcroots
.direnv
.vscode
.terraform
.terraform.*
terraform.tfstate
terraform.tfstate.*
*.log
42 changes: 12 additions & 30 deletions examples/terraform-provider-null/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/terraform-provider-null/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "null"
name = "terraform-provider-null"
version = "0.1.0"
edition = "2021"

[profile.release]
strip = "debuginfo"

[dependencies]
tf-provider = "0.1"
tf-provider = { path = "../../" }
tokio = { version = "1.0", features = [
"rt-multi-thread",
"macros",
Expand Down
6 changes: 3 additions & 3 deletions examples/terraform-provider-null/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

mod provider;
mod resource;
mod null_provider;
mod null_resource;

use anyhow::Result;

use provider::NullProvider;
use null_provider::NullProvider;
use tf_provider::serve;

#[tokio::main]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use async_trait::async_trait;

use tf_provider::{map, Block, Description, Provider, Schema, ValueEmpty};

use crate::resource::NullResource;
use crate::null_resource::NullResource;

#[derive(Debug, Default, Clone)]
pub struct NullProvider;
Expand Down
14 changes: 14 additions & 0 deletions examples/terraform-provider-null/tf-test/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
terraform {
required_providers {
null = {
source = "localhost/aneoconsulting/null"
version = "= 0.1.0"
}
}
}

resource "null_resource" "test" {
triggers = {
a = 1
}
}

0 comments on commit d9768d7

Please sign in to comment.