Skip to content

Commit

Permalink
Fix transitive dependency test (#149)
Browse files Browse the repository at this point in the history
glibc-locale-posix is no longer a dependency of wolfi-baselayout:
wolfi-dev/os@5c347fa

Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
  • Loading branch information
jonjohnsonjr authored Sep 1, 2023
1 parent 9443d09 commit 39eb08c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions internal/provider/config_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,18 @@ data "apko_config" "this" {
config_contents = <<EOF
contents:
packages:
- ca-certificates-bundle
- tzdata
EOF
}`,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.apko_config.this", "config.archs.#", "2"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.archs.0", "amd64"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.archs.1", "arm64"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.packages.#", "4"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.packages.#", "3"),
// This is pulled in as a transitive dependency of wolfi-baselayout.
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.0", regexp.MustCompile("^ca-certificates-bundle=.*")),
// This is pulled in as a transitive dependency.
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.1", regexp.MustCompile("^glibc-locale-posix=.*")),
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.2", regexp.MustCompile("^tzdata=.*")),
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.3", regexp.MustCompile("^wolfi-baselayout=.*")),
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.1", regexp.MustCompile("^tzdata=.*")),
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.2", regexp.MustCompile("^wolfi-baselayout=.*")),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.repositories.#", "1"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.repositories.0", "https://packages.wolfi.dev/os"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.keyring.#", "1"),
Expand Down Expand Up @@ -200,19 +198,17 @@ archs:
- aarch64
contents:
packages:
- ca-certificates-bundle
- tzdata
EOF
}`,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.apko_config.this", "config.archs.#", "1"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.archs.0", "arm64"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.packages.#", "4"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.packages.#", "3"),
// This is pulled in as a transitive dependency of wolfi-baselayout.
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.0", regexp.MustCompile("^ca-certificates-bundle=.*")),
// This is pulled in as a transitive dependency.
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.1", regexp.MustCompile("^glibc-locale-posix=.*")),
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.2", regexp.MustCompile("^tzdata=.*")),
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.3", regexp.MustCompile("^wolfi-baselayout=.*")),
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.1", regexp.MustCompile("^tzdata=.*")),
resource.TestMatchResourceAttr("data.apko_config.this", "config.contents.packages.2", regexp.MustCompile("^wolfi-baselayout=.*")),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.repositories.#", "1"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.repositories.0", "https://packages.wolfi.dev/os"),
resource.TestCheckResourceAttr("data.apko_config.this", "config.contents.keyring.#", "1"),
Expand Down

0 comments on commit 39eb08c

Please sign in to comment.