diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5074bff0..5cf25563 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,4 +17,4 @@ Relates to # ## Checklist before merging - [ ] Test, docs, adr added or updated as needed -- [ ] [Contributor Guide Steps](https://github.com/defenseunicorns/uds-cli/blob/main/CONTRIBUTING.md)(https://github.com/defenseunicorns/uds-template-capability/blob/main/CONTRIBUTING.md#submitting-a-pull-request) followed +- [ ] [Contributor Guide Steps](https://github.com/defenseunicorns/uds-cli/blob/main/CONTRIBUTING.md) followed diff --git a/main.go b/main.go index bd0ec340..255515f3 100644 --- a/main.go +++ b/main.go @@ -4,8 +4,17 @@ // Package main is the entrypoint for the uds binary. package main -import "github.com/defenseunicorns/uds-cli/src/cmd" +import ( + "embed" + + "github.com/defenseunicorns/uds-cli/src/cmd" + "github.com/defenseunicorns/zarf/src/pkg/packager/lint" +) + +//go:embed zarf.schema.json +var zarfSchema embed.FS func main() { + lint.ZarfSchema = zarfSchema cmd.Execute() } diff --git a/src/test/e2e/zarf_test.go b/src/test/e2e/zarf_test.go new file mode 100644 index 00000000..c5807505 --- /dev/null +++ b/src/test/e2e/zarf_test.go @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023-Present The UDS Authors + +// Package test provides e2e tests for UDS. +package test + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/require" +) + +// NOTE: These tests test that the embedded `zarf` commands are imported properly and function as expected + +// TestZarfLint tests to ensure that the `zarf dev lint` command functions (which requires the zarf schema to be embedded in main.go) +func TestZarfLint(t *testing.T) { + cmd := strings.Split("zarf dev lint src/test/packages/podinfo", " ") + _, stdErr, err := e2e.UDS(cmd...) + require.NoError(t, err) + require.Contains(t, stdErr, "Image not pinned with digest - ghcr.io/stefanprodan/podinfo:6.4.0") +}