diff --git a/.circleci/config.yml b/.circleci/config.yml index 128001de..f3192611 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ jobs: - run: name: Build the program - command: go build + command: go build cmd/compliance-masonry/compliance-masonry.go cmd/compliance-masonry/diff.go - run: name: Run tests command: ./.circleci/coverage.sh diff --git a/.codeclimate.yml b/.codeclimate.yml index 21606e20..aaaa846a 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -15,5 +15,5 @@ ratings: paths: - "**.go" exclude_paths: -- fixtures/ +- test/ - vendor/ diff --git a/.dockerignore b/.dockerignore index fc94de92..c2b74613 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,12 +1,11 @@ -circleci/ +.circleci/ docs/ -exampleplugin/ -fixtures/ +examples/ +test/ .codeclimate.yml .git .gitignore .goxc.json appveyor.yml -circle.yml CONTRIBUTING.md -release.sh \ No newline at end of file +release.sh diff --git a/.gitignore b/.gitignore index e325357d..f08c2fed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -.goxc.local.json /compliance-masonry *.swp *.out diff --git a/appveyor.yml b/appveyor.yml index 6fdc1228..783d6fc4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,6 +17,6 @@ install: set PATH=%PATH%;%GOPATH%\bin build_script: -- cmd: go build +- cmd: go build cmd/compliance-masonry/compliance-masonry.go cmd/compliance-masonry/diff.go test_script: - cmd: FOR /F %%A IN ('glide novendor') DO go test -v %%A || exit /b 1 diff --git a/masonry-go.go b/cmd/compliance-masonry/compliance-masonry.go similarity index 95% rename from masonry-go.go rename to cmd/compliance-masonry/compliance-masonry.go index 29b52e0a..e3bb5ed7 100644 --- a/masonry-go.go +++ b/cmd/compliance-masonry/compliance-masonry.go @@ -8,9 +8,9 @@ import ( "path/filepath" "github.com/codegangsta/cli" - "github.com/opencontrol/compliance-masonry/commands/docs" - "github.com/opencontrol/compliance-masonry/commands/docs/gitbook" - "github.com/opencontrol/compliance-masonry/commands/get" + "github.com/opencontrol/compliance-masonry/pkg/cli/docs" + "github.com/opencontrol/compliance-masonry/pkg/cli/docs/gitbook" + "github.com/opencontrol/compliance-masonry/pkg/cli/get" "github.com/opencontrol/compliance-masonry/tools/constants" "github.com/opencontrol/compliance-masonry/tools/fs" "github.com/opencontrol/compliance-masonry/version" diff --git a/compliance_masonry_go_suite_test.go b/cmd/compliance-masonry/compliance_masonry_suite_test.go similarity index 100% rename from compliance_masonry_go_suite_test.go rename to cmd/compliance-masonry/compliance_masonry_suite_test.go diff --git a/masonry-go_test.go b/cmd/compliance-masonry/compliance_masonry_test.go similarity index 89% rename from masonry-go_test.go rename to cmd/compliance-masonry/compliance_masonry_test.go index 29bf8728..27d80175 100644 --- a/masonry-go_test.go +++ b/cmd/compliance-masonry/compliance_masonry_test.go @@ -60,7 +60,7 @@ var _ = Describe("Masonry CLI", func() { output := Masonry( "docs", "gitbook", "LATO", "-e", exportTempDir, - "-o", filepath.Join("fixtures", "opencontrol_fixtures"), + "-o", filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures"), "-m", "sdfds").Wait(1 * time.Second) Eventually(output.Out.Contents).Should(ContainSubstring("Warning: markdown directory does not exist\n")) Eventually(output.Out.Contents).Should(ContainSubstring("New Gitbook Documentation Created\n")) @@ -73,8 +73,8 @@ var _ = Describe("Masonry CLI", func() { output := Masonry( "docs", "gitbook", "LATO", "-e", exportTempDir, - "-o", filepath.Join("fixtures", "opencontrol_fixtures_with_markdown"), - "-m", filepath.Join("fixtures", "opencontrol_fixtures_with_markdown", "markdowns")).Wait(1 * time.Second) + "-o", filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown"), + "-m", filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown", "markdowns")).Wait(1 * time.Second) Eventually(output.Out.Contents).ShouldNot(ContainSubstring("Warning: markdown directory does not exist\n")) Eventually(output.Out.Contents).Should(ContainSubstring("New Gitbook Documentation Created\n")) }) @@ -101,7 +101,7 @@ var _ = Describe("Masonry CLI", func() { It("should print the number of missing controls", func() { output := Masonry( "diff", "LATO", - "-o", filepath.Join("fixtures", "opencontrol_fixtures")).Wait(1 * time.Second) + "-o", filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures")).Wait(1 * time.Second) Eventually(output.Out.Contents).Should(ContainSubstring("Number of missing controls:")) }) }) @@ -109,7 +109,7 @@ var _ = Describe("Masonry CLI", func() { }) func Masonry(args ...string) *Session { - path, err := Build("github.com/opencontrol/compliance-masonry") + path, err := Build("github.com/opencontrol/compliance-masonry/cmd/compliance-masonry") Expect(err).NotTo(HaveOccurred()) cmd := exec.Command(path, args...) stdin, err := cmd.StdinPipe() diff --git a/diff.go b/cmd/compliance-masonry/diff.go similarity index 95% rename from diff.go rename to cmd/compliance-masonry/diff.go index efc0f24d..1f626f83 100644 --- a/diff.go +++ b/cmd/compliance-masonry/diff.go @@ -3,7 +3,7 @@ package main import ( "fmt" "github.com/codegangsta/cli" - "github.com/opencontrol/compliance-masonry/commands/diff" + "github.com/opencontrol/compliance-masonry/pkg/cli/diff" "github.com/tg/gosortmap" ) diff --git a/diff_test.go b/cmd/compliance-masonry/diff_test.go similarity index 94% rename from diff_test.go rename to cmd/compliance-masonry/diff_test.go index 0612123e..de10266a 100644 --- a/diff_test.go +++ b/cmd/compliance-masonry/diff_test.go @@ -34,7 +34,7 @@ var _ = Describe("Diff", func() { } }) It("should return return the number a missing controls when given a certification", func() { - err := app.Run([]string{app.Name, "diff", "LATO", "-o", filepath.Join("fixtures", "opencontrol_fixtures")}) + err := app.Run([]string{app.Name, "diff", "LATO", "-o", filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures")}) assert.Nil(GinkgoT(), err) assert.Contains(GinkgoT(), buffer.String(), "Number of missing controls:") }) diff --git a/exampleplugin/example.go b/examples/example.go similarity index 85% rename from exampleplugin/example.go rename to examples/example.go index ca456d78..ad261518 100644 --- a/exampleplugin/example.go +++ b/examples/example.go @@ -2,8 +2,8 @@ package main import ( "fmt" - "github.com/opencontrol/compliance-masonry/lib" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "io" "os" ) diff --git a/exampleplugin/example_test.go b/examples/example_test.go similarity index 88% rename from exampleplugin/example_test.go rename to examples/example_test.go index a45903a1..9b1a8614 100644 --- a/exampleplugin/example_test.go +++ b/examples/example_test.go @@ -5,8 +5,8 @@ import ( . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" . "github.com/onsi/gomega/gexec" - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/common/mocks" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common/mocks" "github.com/stretchr/testify/assert" "os" "os/exec" @@ -48,8 +48,8 @@ var _ = Describe("Exampleplugin", func() { Describe("run", func() { Context("When running it on data in a workspace", func() { It("should find the data and print it out to standard out", func() { - wsPath := filepath.Join("..", "fixtures", "opencontrol_fixtures") - certPath := filepath.Join("..", "..", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml") + wsPath := filepath.Join("..", "test", "fixtures", "opencontrol_fixtures") + certPath := filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml") buffer := NewBuffer() run(wsPath, certPath, buffer) Expect(buffer).To(Say("partial")) @@ -84,12 +84,12 @@ func cleanupOpencontrolWorkspace() { } func Masonry(args ...string) *Session { - path, err := Build("github.com/opencontrol/compliance-masonry") + path, err := Build("github.com/opencontrol/compliance-masonry/cmd/compliance-masonry") Expect(err).NotTo(HaveOccurred()) return createCommand(path, args...) } func Plugin(args ...string) *Session { - path, err := Build("github.com/opencontrol/compliance-masonry/exampleplugin") + path, err := Build("github.com/opencontrol/compliance-masonry/examples") Expect(err).NotTo(HaveOccurred()) return createCommand(path, args...) } diff --git a/exampleplugin/exampleplugin_suite_test.go b/examples/exampleplugin_suite_test.go similarity index 100% rename from exampleplugin/exampleplugin_suite_test.go rename to examples/exampleplugin_suite_test.go diff --git a/exampleplugin/opencontrol.yaml b/examples/opencontrol.yaml similarity index 100% rename from exampleplugin/opencontrol.yaml rename to examples/opencontrol.yaml diff --git a/commands/diff/diff_suite_test.go b/pkg/cli/diff/diff_suite_test.go similarity index 100% rename from commands/diff/diff_suite_test.go rename to pkg/cli/diff/diff_suite_test.go diff --git a/commands/diff/inventory.go b/pkg/cli/diff/inventory.go similarity index 97% rename from commands/diff/inventory.go rename to pkg/cli/diff/inventory.go index b3a7d372..b41ee8e1 100644 --- a/commands/diff/inventory.go +++ b/pkg/cli/diff/inventory.go @@ -2,8 +2,8 @@ package diff import ( "fmt" - "github.com/opencontrol/compliance-masonry/lib" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/opencontrol/compliance-masonry/tools/certifications" ) diff --git a/commands/diff/inventory_test.go b/pkg/cli/diff/inventory_test.go similarity index 86% rename from commands/diff/inventory_test.go rename to pkg/cli/diff/inventory_test.go index 0d937896..4551f3b3 100644 --- a/commands/diff/inventory_test.go +++ b/pkg/cli/diff/inventory_test.go @@ -1,7 +1,7 @@ package diff_test import ( - . "github.com/opencontrol/compliance-masonry/commands/diff" + . "github.com/opencontrol/compliance-masonry/pkg/cli/diff" "errors" . "github.com/onsi/ginkgo" @@ -39,7 +39,7 @@ var _ = Describe("Inventory", func() { Context("When there are controls specified in the certification but some controls have been documented", func() { It("should return a subset of the full list of controls", func() { config := Config{ - OpencontrolDir: filepath.Join(workingDir, "..", "..", "fixtures", "opencontrol_fixtures"), + OpencontrolDir: filepath.Join(workingDir, "..", "..", "..", "test", "fixtures", "opencontrol_fixtures"), Certification: "LATO", } i, err := ComputeGapAnalysis(config) @@ -50,7 +50,7 @@ var _ = Describe("Inventory", func() { Context("When there are controls specified in the certification and we have documented them", func() { It("should return no missing controls", func() { config := Config{ - OpencontrolDir: filepath.Join(workingDir, "..", "..", "fixtures", "opencontrol_fixtures_complete"), + OpencontrolDir: filepath.Join(workingDir, "..", "..", "..", "test", "fixtures", "opencontrol_fixtures_complete"), Certification: "LATO", } i, err := ComputeGapAnalysis(config) diff --git a/commands/docs/docs.go b/pkg/cli/docs/docs.go similarity index 91% rename from commands/docs/docs.go rename to pkg/cli/docs/docs.go index ee015607..3a47608c 100644 --- a/commands/docs/docs.go +++ b/pkg/cli/docs/docs.go @@ -3,7 +3,7 @@ package docs import ( "os" - "github.com/opencontrol/compliance-masonry/commands/docs/gitbook" + "github.com/opencontrol/compliance-masonry/pkg/cli/docs/gitbook" "github.com/opencontrol/compliance-masonry/tools/certifications" ) diff --git a/commands/docs/docs_suite_test.go b/pkg/cli/docs/docs_suite_test.go similarity index 100% rename from commands/docs/docs_suite_test.go rename to pkg/cli/docs/docs_suite_test.go diff --git a/commands/docs/docs_test.go b/pkg/cli/docs/docs_test.go similarity index 61% rename from commands/docs/docs_test.go rename to pkg/cli/docs/docs_test.go index 02c9de50..7f06b7f0 100644 --- a/commands/docs/docs_test.go +++ b/pkg/cli/docs/docs_test.go @@ -7,8 +7,8 @@ import ( "os" "path/filepath" - . "github.com/opencontrol/compliance-masonry/commands/docs" - "github.com/opencontrol/compliance-masonry/commands/docs/gitbook" + . "github.com/opencontrol/compliance-masonry/pkg/cli/docs" + "github.com/opencontrol/compliance-masonry/pkg/cli/docs/gitbook" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" @@ -27,7 +27,7 @@ var _ = Describe("Doc Tests", func() { Entry( "Check that the gitbook is correctly exported given the fixtures", gitbook.Config{ - OpencontrolDir: filepath.Join("..", "..", "fixtures", "opencontrol_fixtures"), + OpencontrolDir: filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures"), Certification: "LATO", MarkdownPath: "", }, @@ -49,9 +49,9 @@ var _ = Describe("Doc Tests", func() { Entry( "Check that gitbook is created with markdowns", gitbook.Config{ - OpencontrolDir: filepath.Join("..", "..", "fixtures", "opencontrol_fixtures_with_markdown"), + OpencontrolDir: filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown"), Certification: "LATO", - MarkdownPath: filepath.Join("..", "..", "fixtures", "opencontrol_fixtures_with_markdown", "markdowns"), + MarkdownPath: filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown", "markdowns"), }, "", nil, @@ -60,20 +60,20 @@ var _ = Describe("Doc Tests", func() { Entry( "Check that thre is an error returned when the certification does not exist", gitbook.Config{ - OpencontrolDir: filepath.Join("..", "..", "fixtures", "opencontrol_fixtures_with_markdown"), + OpencontrolDir: filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown"), Certification: "LAT", - MarkdownPath: filepath.Join("..", "..", "fixtures", "opencontrol_fixtures_with_markdown", "markdowns"), + MarkdownPath: filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown", "markdowns"), }, "", - []error{fmt.Errorf("Error: `%s` does not exist\nUse one of the following:\nLATO", filepath.Join("..", "..", "fixtures", "opencontrol_fixtures_with_markdown", "certifications", "LAT.yaml"))}, + []error{fmt.Errorf("Error: `%s` does not exist\nUse one of the following:\nLATO", filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown", "certifications", "LAT.yaml"))}, ), Entry( "Check that error is returned when certification argument is not present", gitbook.Config{ - OpencontrolDir: filepath.Join("..", "..", "fixtures", "opencontrol_fixtures_with_markdown"), + OpencontrolDir: filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown"), Certification: "", - MarkdownPath: filepath.Join("..", "..", "fixtures", "opencontrol_fixtures_with_markdown", "markdowns/"), + MarkdownPath: filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown", "markdowns/"), }, "", []error{errors.New("Error: Missing Certification Argument")}, diff --git a/commands/docs/gitbook/gitbook.go b/pkg/cli/docs/gitbook/gitbook.go similarity index 94% rename from commands/docs/gitbook/gitbook.go rename to pkg/cli/docs/gitbook/gitbook.go index 70528669..c9b8db54 100644 --- a/commands/docs/gitbook/gitbook.go +++ b/pkg/cli/docs/gitbook/gitbook.go @@ -5,8 +5,8 @@ import ( "path/filepath" "strings" - "github.com/opencontrol/compliance-masonry/lib" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/opencontrol/compliance-masonry/tools/fs" ) diff --git a/commands/docs/gitbook/gitbookCertification.go b/pkg/cli/docs/gitbook/gitbookCertification.go similarity index 98% rename from commands/docs/gitbook/gitbookCertification.go rename to pkg/cli/docs/gitbook/gitbookCertification.go index 364c00bf..42a767d6 100644 --- a/commands/docs/gitbook/gitbookCertification.go +++ b/pkg/cli/docs/gitbook/gitbookCertification.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "path/filepath" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" ) func (openControl *OpenControlGitBook) getResponsibleRole(text string, component common.Component) string { diff --git a/commands/docs/gitbook/gitbookCertification_test.go b/pkg/cli/docs/gitbook/gitbookCertification_test.go similarity index 89% rename from commands/docs/gitbook/gitbookCertification_test.go rename to pkg/cli/docs/gitbook/gitbookCertification_test.go index 5c1a3eeb..3a08a48e 100644 --- a/commands/docs/gitbook/gitbookCertification_test.go +++ b/pkg/cli/docs/gitbook/gitbookCertification_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/opencontrol/compliance-masonry/lib" + "github.com/opencontrol/compliance-masonry/pkg/lib" "github.com/opencontrol/compliance-masonry/tools/fs" ) @@ -24,8 +24,8 @@ type exportControlTest struct { var exportControlTests = []exportControlTest{ // Check that a control is exported correctly { - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures"), - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), "NIST-800-53", "CM-2", "NIST-800-53-CM-2.md", diff --git a/commands/docs/gitbook/gitbookComponents.go b/pkg/cli/docs/gitbook/gitbookComponents.go similarity index 100% rename from commands/docs/gitbook/gitbookComponents.go rename to pkg/cli/docs/gitbook/gitbookComponents.go diff --git a/commands/docs/gitbook/gitbookComponents_test.go b/pkg/cli/docs/gitbook/gitbookComponents_test.go similarity index 88% rename from commands/docs/gitbook/gitbookComponents_test.go rename to pkg/cli/docs/gitbook/gitbookComponents_test.go index ff96111f..757eb517 100644 --- a/commands/docs/gitbook/gitbookComponents_test.go +++ b/pkg/cli/docs/gitbook/gitbookComponents_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" - v2 "github.com/opencontrol/compliance-masonry/lib/components/versions/2_0_0" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + v2 "github.com/opencontrol/compliance-masonry/pkg/lib/components/versions/2_0_0" ) type componentExportTest struct { diff --git a/commands/docs/gitbook/gitbookSummaries.go b/pkg/cli/docs/gitbook/gitbookSummaries.go similarity index 98% rename from commands/docs/gitbook/gitbookSummaries.go rename to pkg/cli/docs/gitbook/gitbookSummaries.go index 0bb3710c..fbb942c3 100644 --- a/commands/docs/gitbook/gitbookSummaries.go +++ b/pkg/cli/docs/gitbook/gitbookSummaries.go @@ -2,7 +2,7 @@ package gitbook import ( "fmt" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "io/ioutil" "path/filepath" "strings" diff --git a/commands/docs/gitbook/gitbookSummaries_test.go b/pkg/cli/docs/gitbook/gitbookSummaries_test.go similarity index 77% rename from commands/docs/gitbook/gitbookSummaries_test.go rename to pkg/cli/docs/gitbook/gitbookSummaries_test.go index 73452efe..ac85bace 100644 --- a/commands/docs/gitbook/gitbookSummaries_test.go +++ b/pkg/cli/docs/gitbook/gitbookSummaries_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/opencontrol/compliance-masonry/lib" + "github.com/opencontrol/compliance-masonry/pkg/lib" "github.com/opencontrol/compliance-masonry/tools/fs" ) @@ -29,10 +29,10 @@ type buildStandardsSummariesTest struct { var buildComponentsSummariesTests = []buildComponentsSummariesTest{ // Check that the component summary is correctly exported { - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures"), - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), "", - filepath.Join("..", "..", "..", "fixtures", "exports_fixtures", "gitbook_exports", "components_readme.md"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "exports_fixtures", "gitbook_exports", "components_readme.md"), }, } @@ -61,11 +61,11 @@ func TestBuildComponentsSummaries(t *testing.T) { var buildStandardsSummariesTests = []buildStandardsSummariesTest{ // Check that a standards summary is correctly exported { - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures"), - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), "", - filepath.Join("..", "..", "..", "fixtures", "exports_fixtures", "gitbook_exports", "standards_readme.md"), - filepath.Join("..", "..", "..", "fixtures", "exports_fixtures", "gitbook_exports", "standards"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "exports_fixtures", "gitbook_exports", "standards_readme.md"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "exports_fixtures", "gitbook_exports", "standards"), }, } diff --git a/commands/docs/gitbook/gitbook_test.go b/pkg/cli/docs/gitbook/gitbook_test.go similarity index 78% rename from commands/docs/gitbook/gitbook_test.go rename to pkg/cli/docs/gitbook/gitbook_test.go index 30b8ffff..cbc2721b 100644 --- a/commands/docs/gitbook/gitbook_test.go +++ b/pkg/cli/docs/gitbook/gitbook_test.go @@ -62,17 +62,17 @@ func TestReplaceParentheses(t *testing.T) { var buildGitbookTests = []buildGitbookTest{ // Check that the gitbook is correctly exported given the fixtures { - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures"), - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), "", - filepath.Join("..", "..", "..", "fixtures", "exports_fixtures", "complete_export"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "exports_fixtures", "complete_export"), }, // Check that the gitbook is correctly exported given the fixtures with markdowns { - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures_with_markdown"), - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures_with_markdown", "certifications", "LATO.yaml"), - filepath.Join("..", "..", "..", "fixtures", "opencontrol_fixtures_with_markdown", "markdowns"), - filepath.Join("..", "..", "..", "fixtures", "exports_fixtures", "complete_export_with_markdown"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown", "certifications", "LATO.yaml"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "opencontrol_fixtures_with_markdown", "markdowns"), + filepath.Join("..", "..", "..", "..", "test", "fixtures", "exports_fixtures", "complete_export_with_markdown"), }, } diff --git a/commands/get/get.go b/pkg/cli/get/get.go similarity index 75% rename from commands/get/get.go rename to pkg/cli/get/get.go index 4f24419c..8dd7c905 100644 --- a/commands/get/get.go +++ b/pkg/cli/get/get.go @@ -1,9 +1,9 @@ package get import ( - "github.com/opencontrol/compliance-masonry/commands/get/resources" - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/opencontrol" + "github.com/opencontrol/compliance-masonry/pkg/cli/get/resources" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol" ) // Get will retrieve all of the resources for the schemas and the resources for all the dependent schemas. diff --git a/commands/get/resources/downloader.go b/pkg/cli/get/resources/downloader.go similarity index 92% rename from commands/get/resources/downloader.go rename to pkg/cli/get/resources/downloader.go index dd29dab4..ae5112d4 100644 --- a/commands/get/resources/downloader.go +++ b/pkg/cli/get/resources/downloader.go @@ -1,7 +1,7 @@ package resources import ( - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/opencontrol/compliance-masonry/tools/vcs" ) diff --git a/commands/get/resources/downloader_test.go b/pkg/cli/get/resources/downloader_test.go similarity index 93% rename from commands/get/resources/downloader_test.go rename to pkg/cli/get/resources/downloader_test.go index 6b70545a..faa29c02 100644 --- a/commands/get/resources/downloader_test.go +++ b/pkg/cli/get/resources/downloader_test.go @@ -4,7 +4,7 @@ import ( "errors" . "github.com/onsi/ginkgo" "github.com/onsi/ginkgo/extensions/table" - commonMocks "github.com/opencontrol/compliance-masonry/lib/common/mocks" + commonMocks "github.com/opencontrol/compliance-masonry/pkg/lib/common/mocks" "github.com/opencontrol/compliance-masonry/tools/vcs/mocks" "github.com/stretchr/testify/assert" ) diff --git a/commands/get/resources/getter.go b/pkg/cli/get/resources/getter.go similarity index 98% rename from commands/get/resources/getter.go rename to pkg/cli/get/resources/getter.go index 7286fe8b..93f6ff57 100644 --- a/commands/get/resources/getter.go +++ b/pkg/cli/get/resources/getter.go @@ -1,8 +1,8 @@ package resources import ( - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/opencontrol" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol" "github.com/opencontrol/compliance-masonry/tools/constants" "github.com/opencontrol/compliance-masonry/tools/fs" "github.com/opencontrol/compliance-masonry/tools/mapset" diff --git a/commands/get/resources/getter_test.go b/pkg/cli/get/resources/getter_test.go similarity index 95% rename from commands/get/resources/getter_test.go rename to pkg/cli/get/resources/getter_test.go index 1e5d5550..c58f9b76 100644 --- a/commands/get/resources/getter_test.go +++ b/pkg/cli/get/resources/getter_test.go @@ -4,11 +4,11 @@ import ( "errors" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" - resmocks "github.com/opencontrol/compliance-masonry/commands/get/resources/mocks" - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/common/mocks" - "github.com/opencontrol/compliance-masonry/lib/opencontrol" - parserMocks "github.com/opencontrol/compliance-masonry/lib/opencontrol/mocks" + resmocks "github.com/opencontrol/compliance-masonry/pkg/cli/get/resources/mocks" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common/mocks" + "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol" + parserMocks "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol/mocks" "github.com/opencontrol/compliance-masonry/tools/constants" "github.com/opencontrol/compliance-masonry/tools/fs" fsmocks "github.com/opencontrol/compliance-masonry/tools/fs/mocks" diff --git a/commands/get/resources/mocks/Downloader.go b/pkg/cli/get/resources/mocks/Downloader.go similarity index 88% rename from commands/get/resources/mocks/Downloader.go rename to pkg/cli/get/resources/mocks/Downloader.go index 3e351132..b8b65cf8 100644 --- a/commands/get/resources/mocks/Downloader.go +++ b/pkg/cli/get/resources/mocks/Downloader.go @@ -2,7 +2,7 @@ package mocks import "github.com/stretchr/testify/mock" -import "github.com/opencontrol/compliance-masonry/lib/common" +import "github.com/opencontrol/compliance-masonry/pkg/lib/common" // Downloader is an autogenerated mock type for the Downloader type type Downloader struct { diff --git a/commands/get/resources/mocks/Getter.go b/pkg/cli/get/resources/mocks/Getter.go similarity index 95% rename from commands/get/resources/mocks/Getter.go rename to pkg/cli/get/resources/mocks/Getter.go index 63485d40..ab5db221 100644 --- a/commands/get/resources/mocks/Getter.go +++ b/pkg/cli/get/resources/mocks/Getter.go @@ -1,7 +1,7 @@ package mocks import ( - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/opencontrol/compliance-masonry/tools/constants" "github.com/stretchr/testify/mock" ) diff --git a/commands/get/resources/resources_suite_test.go b/pkg/cli/get/resources/resources_suite_test.go similarity index 100% rename from commands/get/resources/resources_suite_test.go rename to pkg/cli/get/resources/resources_suite_test.go diff --git a/lib/README.md b/pkg/lib/README.md similarity index 89% rename from lib/README.md rename to pkg/lib/README.md index 015a9bfc..11cb4b2d 100644 --- a/lib/README.md +++ b/pkg/lib/README.md @@ -8,8 +8,8 @@ This package (and the sub packages) are the only packages that should be imported by external projects. This lib package is very helpful for those writing plugins to extend the functionality of Masonry. -Additionally, 1) the `lib/common` package contains all the interfaces for -workspace information and 2) the `lib/common/mocks` contains all the +Additionally, 1) the `pkg/lib/common` package contains all the interfaces for +workspace information and 2) the `pkg/lib/common/mocks` contains all the mocks to help with tests. The idea is once you run the `get` command and all the resources @@ -27,7 +27,7 @@ Workspace is the representation of your working space with all the resources gathered together. - How to obtain a workspace: ```go - import "github.com/opencontrol/compliance-masonry/lib" + import "github.com/opencontrol/compliance-masonry/pkg/lib" // some other code @@ -66,13 +66,13 @@ rather a post-processed map of data to help quickly getting component data for a particular control name - standard name combination. ### Mock generation -The `lib/common/mocks` is a package that is auto-generated via +The `pkg/lib/common/mocks` is a package that is auto-generated via [`mockery`](https://github.com/vektra/mockery). Follow the instructions there to install `mockery`. Whenever a modification is made to an existing interface or a new interface is created, you should use mockery to (re)generate the mock - while inside the `lib/common` folder. + while inside the `pkg/lib/common` folder. ```sh mockery -name NameOfInterface diff --git a/lib/certifications.go b/pkg/lib/certifications.go similarity index 77% rename from lib/certifications.go rename to pkg/lib/certifications.go index 6cb9610f..50dfe2b1 100644 --- a/lib/certifications.go +++ b/pkg/lib/certifications.go @@ -1,8 +1,8 @@ package lib import ( - "github.com/opencontrol/compliance-masonry/lib/certifications" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/certifications" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" ) // LoadCertification struct loads certifications into a Certification struct diff --git a/lib/certifications/certification.go b/pkg/lib/certifications/certification.go similarity index 80% rename from lib/certifications/certification.go rename to pkg/lib/certifications/certification.go index 2f60bb75..f30cae9e 100644 --- a/lib/certifications/certification.go +++ b/pkg/lib/certifications/certification.go @@ -1,8 +1,8 @@ package certifications import ( - v1_0_0 "github.com/opencontrol/compliance-masonry/lib/certifications/versions/1_0_0" - "github.com/opencontrol/compliance-masonry/lib/common" + v1_0_0 "github.com/opencontrol/compliance-masonry/pkg/lib/certifications/versions/1_0_0" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "gopkg.in/yaml.v2" "io/ioutil" ) diff --git a/lib/certifications/certification_test.go b/pkg/lib/certifications/certification_test.go similarity index 74% rename from lib/certifications/certification_test.go rename to pkg/lib/certifications/certification_test.go index 071d78e9..7a467a3c 100644 --- a/lib/certifications/certification_test.go +++ b/pkg/lib/certifications/certification_test.go @@ -1,9 +1,9 @@ package certifications_test import ( - "github.com/opencontrol/compliance-masonry/lib/certifications" - v1_0_0 "github.com/opencontrol/compliance-masonry/lib/certifications/versions/1_0_0" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/certifications" + v1_0_0 "github.com/opencontrol/compliance-masonry/pkg/lib/certifications/versions/1_0_0" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/stretchr/testify/assert" "path/filepath" "testing" @@ -23,7 +23,7 @@ type certificationTestError struct { var v1certificationTests = []v1certificationTest{ // Test loading a certification file that has the LATO key, 2 standards, and 6 controls. { - filepath.Join("..", "..", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), + filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), v1_0_0.Certification{Key: "LATO"}, map[string][]string{ "NIST-800-53": {"AC-2", "AC-6", "CM-2"}, @@ -50,9 +50,9 @@ func TestLoadCertification(t *testing.T) { var certificationTestErrors = []certificationTestError{ // Test a file that can't be read - {filepath.Join("..", "..", "fixtures", "opencontrol_fixtures", "certifications"), common.ErrReadFile}, + {filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures", "certifications"), common.ErrReadFile}, // Test a file that has a broken schema - {filepath.Join("..", "..", "fixtures", "opencontrol_fixtures", "components", "EC2", "artifact-ec2-1.png"), common.ErrCertificationSchema}, + {filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures", "components", "EC2", "artifact-ec2-1.png"), common.ErrCertificationSchema}, } func TestLoadCertificationErrors(t *testing.T) { diff --git a/lib/certifications/versions/1_0_0/certification.go b/pkg/lib/certifications/versions/1_0_0/certification.go similarity index 100% rename from lib/certifications/versions/1_0_0/certification.go rename to pkg/lib/certifications/versions/1_0_0/certification.go diff --git a/lib/certifications/versions/1_0_0/certification_test.go b/pkg/lib/certifications/versions/1_0_0/certification_test.go similarity index 95% rename from lib/certifications/versions/1_0_0/certification_test.go rename to pkg/lib/certifications/versions/1_0_0/certification_test.go index 11c47497..754df94d 100644 --- a/lib/certifications/versions/1_0_0/certification_test.go +++ b/pkg/lib/certifications/versions/1_0_0/certification_test.go @@ -1,7 +1,7 @@ package certification_test import ( - "github.com/opencontrol/compliance-masonry/lib/certifications/versions/1_0_0" + "github.com/opencontrol/compliance-masonry/pkg/lib/certifications/versions/1_0_0" "testing" ) diff --git a/lib/common/certification.go b/pkg/lib/common/certification.go similarity index 100% rename from lib/common/certification.go rename to pkg/lib/common/certification.go diff --git a/lib/common/component.go b/pkg/lib/common/component.go similarity index 100% rename from lib/common/component.go rename to pkg/lib/common/component.go diff --git a/lib/common/control.go b/pkg/lib/common/control.go similarity index 100% rename from lib/common/control.go rename to pkg/lib/common/control.go diff --git a/lib/common/errors.go b/pkg/lib/common/errors.go similarity index 100% rename from lib/common/errors.go rename to pkg/lib/common/errors.go diff --git a/lib/common/mocks/Certification.go b/pkg/lib/common/mocks/Certification.go similarity index 94% rename from lib/common/mocks/Certification.go rename to pkg/lib/common/mocks/Certification.go index a13a90e5..d0469b24 100644 --- a/lib/common/mocks/Certification.go +++ b/pkg/lib/common/mocks/Certification.go @@ -1,6 +1,6 @@ package mocks -import common "github.com/opencontrol/compliance-masonry/lib/common" +import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" import mock "github.com/stretchr/testify/mock" // Certification is an autogenerated mock type for the Certification type diff --git a/lib/common/mocks/Component.go b/pkg/lib/common/mocks/Component.go similarity index 97% rename from lib/common/mocks/Component.go rename to pkg/lib/common/mocks/Component.go index c2de5d86..cc6674ec 100644 --- a/lib/common/mocks/Component.go +++ b/pkg/lib/common/mocks/Component.go @@ -1,6 +1,6 @@ package mocks -import common "github.com/opencontrol/compliance-masonry/lib/common" +import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" import mock "github.com/stretchr/testify/mock" import semver "github.com/blang/semver" diff --git a/lib/common/mocks/Control.go b/pkg/lib/common/mocks/Control.go similarity index 92% rename from lib/common/mocks/Control.go rename to pkg/lib/common/mocks/Control.go index b8558654..00311e90 100644 --- a/lib/common/mocks/Control.go +++ b/pkg/lib/common/mocks/Control.go @@ -1,6 +1,6 @@ package mocks -import common "github.com/opencontrol/compliance-masonry/lib/common" +import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" import mock "github.com/stretchr/testify/mock" // Control is an autogenerated mock type for the Control type diff --git a/lib/common/mocks/OpenControl.go b/pkg/lib/common/mocks/OpenControl.go similarity index 96% rename from lib/common/mocks/OpenControl.go rename to pkg/lib/common/mocks/OpenControl.go index 8475038f..cccf8d84 100644 --- a/lib/common/mocks/OpenControl.go +++ b/pkg/lib/common/mocks/OpenControl.go @@ -1,6 +1,6 @@ package mocks -import common "github.com/opencontrol/compliance-masonry/lib/common" +import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" import mock "github.com/stretchr/testify/mock" // OpenControl is an autogenerated mock type for the OpenControl type diff --git a/lib/common/mocks/RemoteSource.go b/pkg/lib/common/mocks/RemoteSource.go similarity index 94% rename from lib/common/mocks/RemoteSource.go rename to pkg/lib/common/mocks/RemoteSource.go index 08d8d2e8..4facbe72 100644 --- a/lib/common/mocks/RemoteSource.go +++ b/pkg/lib/common/mocks/RemoteSource.go @@ -1,6 +1,6 @@ package mocks -import common "github.com/opencontrol/compliance-masonry/lib/common" +import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" import mock "github.com/stretchr/testify/mock" // RemoteSource is an autogenerated mock type for the RemoteSource type diff --git a/lib/common/mocks/Satisfies.go b/pkg/lib/common/mocks/Satisfies.go similarity index 97% rename from lib/common/mocks/Satisfies.go rename to pkg/lib/common/mocks/Satisfies.go index 40d54aee..cb5bfaf2 100644 --- a/lib/common/mocks/Satisfies.go +++ b/pkg/lib/common/mocks/Satisfies.go @@ -1,6 +1,6 @@ package mocks -import common "github.com/opencontrol/compliance-masonry/lib/common" +import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" import mock "github.com/stretchr/testify/mock" // Satisfies is an autogenerated mock type for the Satisfies type diff --git a/lib/common/mocks/Section.go b/pkg/lib/common/mocks/Section.go similarity index 90% rename from lib/common/mocks/Section.go rename to pkg/lib/common/mocks/Section.go index 9754ed29..a6202051 100644 --- a/lib/common/mocks/Section.go +++ b/pkg/lib/common/mocks/Section.go @@ -1,6 +1,6 @@ package mocks -import common "github.com/opencontrol/compliance-masonry/lib/common" +import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" import mock "github.com/stretchr/testify/mock" // Section is an autogenerated mock type for the Section type diff --git a/lib/common/mocks/Standard.go b/pkg/lib/common/mocks/Standard.go similarity index 95% rename from lib/common/mocks/Standard.go rename to pkg/lib/common/mocks/Standard.go index e7d24dca..a0be5078 100644 --- a/lib/common/mocks/Standard.go +++ b/pkg/lib/common/mocks/Standard.go @@ -1,6 +1,6 @@ package mocks -import common "github.com/opencontrol/compliance-masonry/lib/common" +import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" import mock "github.com/stretchr/testify/mock" // Standard is an autogenerated mock type for the Standard type diff --git a/lib/common/mocks/Workspace.go b/pkg/lib/common/mocks/Workspace.go similarity index 97% rename from lib/common/mocks/Workspace.go rename to pkg/lib/common/mocks/Workspace.go index b94d9a70..441a8a84 100644 --- a/lib/common/mocks/Workspace.go +++ b/pkg/lib/common/mocks/Workspace.go @@ -1,6 +1,6 @@ package mocks -import common "github.com/opencontrol/compliance-masonry/lib/common" +import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" import mock "github.com/stretchr/testify/mock" // Workspace is an autogenerated mock type for the Workspace type diff --git a/lib/common/opencontrol.go b/pkg/lib/common/opencontrol.go similarity index 100% rename from lib/common/opencontrol.go rename to pkg/lib/common/opencontrol.go diff --git a/lib/common/references.go b/pkg/lib/common/references.go similarity index 100% rename from lib/common/references.go rename to pkg/lib/common/references.go diff --git a/lib/common/references_test.go b/pkg/lib/common/references_test.go similarity index 100% rename from lib/common/references_test.go rename to pkg/lib/common/references_test.go diff --git a/lib/common/standard.go b/pkg/lib/common/standard.go similarity index 100% rename from lib/common/standard.go rename to pkg/lib/common/standard.go diff --git a/lib/common/verifications.go b/pkg/lib/common/verifications.go similarity index 100% rename from lib/common/verifications.go rename to pkg/lib/common/verifications.go diff --git a/lib/common/verifications_test.go b/pkg/lib/common/verifications_test.go similarity index 97% rename from lib/common/verifications_test.go rename to pkg/lib/common/verifications_test.go index 5e9a0b84..51f5283c 100644 --- a/lib/common/verifications_test.go +++ b/pkg/lib/common/verifications_test.go @@ -1,7 +1,7 @@ package common_test import ( - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "testing" ) diff --git a/lib/common/workspace.go b/pkg/lib/common/workspace.go similarity index 100% rename from lib/common/workspace.go rename to pkg/lib/common/workspace.go diff --git a/lib/components.go b/pkg/lib/components.go similarity index 95% rename from lib/components.go rename to pkg/lib/components.go index 75e281a7..c88e0aa1 100644 --- a/lib/components.go +++ b/pkg/lib/components.go @@ -5,8 +5,8 @@ import ( "fmt" - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/components" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/components" ) // componentsMap struct is a thread-safe structure mapping for components diff --git a/lib/components/README.md b/pkg/lib/components/README.md similarity index 100% rename from lib/components/README.md rename to pkg/lib/components/README.md diff --git a/lib/components/component.go b/pkg/lib/components/component.go similarity index 98% rename from lib/components/component.go rename to pkg/lib/components/component.go index 966362b4..a3212c6e 100644 --- a/lib/components/component.go +++ b/pkg/lib/components/component.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/opencontrol/compliance-masonry/tools/constants" "github.com/opencontrol/compliance-masonry/tools/fs" "path/filepath" diff --git a/lib/components/component_test.go b/pkg/lib/components/component_test.go similarity index 100% rename from lib/components/component_test.go rename to pkg/lib/components/component_test.go diff --git a/lib/components/parse.go b/pkg/lib/components/parse.go similarity index 85% rename from lib/components/parse.go rename to pkg/lib/components/parse.go index 36abf2eb..8c65690e 100644 --- a/lib/components/parse.go +++ b/pkg/lib/components/parse.go @@ -4,10 +4,10 @@ import ( "fmt" "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" - v2 "github.com/opencontrol/compliance-masonry/lib/components/versions/2_0_0" - v3 "github.com/opencontrol/compliance-masonry/lib/components/versions/3_0_0" - v31 "github.com/opencontrol/compliance-masonry/lib/components/versions/3_1_0" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + v2 "github.com/opencontrol/compliance-masonry/pkg/lib/components/versions/2_0_0" + v3 "github.com/opencontrol/compliance-masonry/pkg/lib/components/versions/3_0_0" + v31 "github.com/opencontrol/compliance-masonry/pkg/lib/components/versions/3_1_0" "gopkg.in/yaml.v2" ) diff --git a/lib/components/parse_test.go b/pkg/lib/components/parse_test.go similarity index 85% rename from lib/components/parse_test.go rename to pkg/lib/components/parse_test.go index bb121d92..d36bbb86 100644 --- a/lib/components/parse_test.go +++ b/pkg/lib/components/parse_test.go @@ -6,11 +6,11 @@ import ( "testing" "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/components" - v2 "github.com/opencontrol/compliance-masonry/lib/components/versions/2_0_0" - v3 "github.com/opencontrol/compliance-masonry/lib/components/versions/3_0_0" - v31 "github.com/opencontrol/compliance-masonry/lib/components/versions/3_1_0" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/components" + v2 "github.com/opencontrol/compliance-masonry/pkg/lib/components/versions/2_0_0" + v3 "github.com/opencontrol/compliance-masonry/pkg/lib/components/versions/3_0_0" + v31 "github.com/opencontrol/compliance-masonry/pkg/lib/components/versions/3_1_0" "github.com/opencontrol/compliance-masonry/tools/constants" "github.com/stretchr/testify/assert" ) @@ -85,7 +85,7 @@ var v3_1Satisfies = []v31.Satisfies{ var componentV3_1Tests = []componentV3_1Test{ // Check that a component with a key loads correctly - {filepath.Join("..", "..", "fixtures", "component_fixtures", "v3_1_0", "EC2"), v31.Component{ + {filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "v3_1_0", "EC2"), v31.Component{ Name: "Amazon Elastic Compute Cloud", Key: "EC2", References: common.GeneralReferences{{}}, @@ -140,7 +140,7 @@ var v3Satisfies = []v3.Satisfies{ var componentV3Tests = []componentV3Test{ // Check that a component with a key loads correctly - {filepath.Join("..", "..", "fixtures", "component_fixtures", "v3_0_0", "EC2"), v3.Component{ + {filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "v3_0_0", "EC2"), v3.Component{ Name: "Amazon Elastic Compute Cloud", Key: "EC2", References: common.GeneralReferences{{}}, @@ -150,7 +150,7 @@ var componentV3Tests = []componentV3Test{ ResponsibleRole: "AWS Staff", }}, // Check that a component with no key, uses the key of its directory and loads correctly - {filepath.Join("..", "..", "fixtures", "component_fixtures", "v3_0_0", "EC2WithKey"), v3.Component{ + {filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "v3_0_0", "EC2WithKey"), v3.Component{ Name: "Amazon Elastic Compute Cloud", Key: "EC2", References: common.GeneralReferences{{}}, @@ -182,7 +182,7 @@ var v2Satisfies = []v2.Satisfies{ var componentV2Tests = []componentV2Test{ // Check that a component with a key loads correctly - {filepath.Join("..", "..", "fixtures", "component_fixtures", "v2_0_0", "EC2"), v2.Component{ + {filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "v2_0_0", "EC2"), v2.Component{ Name: "Amazon Elastic Compute Cloud", Key: "EC2", References: common.GeneralReferences{{}}, @@ -191,7 +191,7 @@ var componentV2Tests = []componentV2Test{ SchemaVersion: semver.MustParse("2.0.0"), }}, // Check that a component with no key, uses the key of its directory and loads correctly - {filepath.Join("..", "..", "fixtures", "component_fixtures", "v2_0_0", "EC2WithKey"), v2.Component{ + {filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "v2_0_0", "EC2WithKey"), v2.Component{ Name: "Amazon Elastic Compute Cloud", Key: "EC2", References: common.GeneralReferences{{}}, @@ -270,23 +270,23 @@ var componentTestErrors = []componentTestError{ errors.New(constants.ErrComponentFileDNE)}, // Check loading a component with a broken schema - {filepath.Join("..", "..", "fixtures", "component_fixtures", "common", "EC2BrokenControl"), - errors.New("Unable to parse component " + filepath.Join("..", "..", "fixtures", "component_fixtures", "common", "EC2BrokenControl", "component.yaml") + ". Error: yaml: line 16: did not find expected key")}, + {filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "common", "EC2BrokenControl"), + errors.New("Unable to parse component " + filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "common", "EC2BrokenControl", "component.yaml") + ". Error: yaml: line 16: did not find expected key")}, // Check for version that is unsupported - {filepath.Join("..", "..", "fixtures", "component_fixtures", "common", "EC2UnsupportedVersion"), + {filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "common", "EC2UnsupportedVersion"), common.ErrUnknownSchemaVersion}, // Check for the case when someone says they are using a certain version (2.0) but it actually is not - {filepath.Join("..", "..", "fixtures", "component_fixtures", "common", "EC2_InvalidFieldTypeForVersion2_0"), + {filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "common", "EC2_InvalidFieldTypeForVersion2_0"), errors.New("Unable to parse component. Please check component.yaml schema for version 2.0.0" + "\n\tFile: " + - filepath.Join("..", "..", "fixtures", "component_fixtures", "common", "EC2_InvalidFieldTypeForVersion2_0", "component.yaml") + + filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "common", "EC2_InvalidFieldTypeForVersion2_0", "component.yaml") + "\n\tParse error: yaml: unmarshal errors:" + "\n line 9: cannot unmarshal !!str `wrong` into common.CoveredByList")}, // Check for the case when non-2.0 version is not in semver format. - {filepath.Join("..", "..", "fixtures", "component_fixtures", "common", "EC2VersionNotSemver"), + {filepath.Join("..", "..", "..", "test", "fixtures", "component_fixtures", "common", "EC2VersionNotSemver"), components.NewComponentParseError("Version 1 is not in semver format")}, } diff --git a/lib/components/versions/2_0_0/component.go b/pkg/lib/components/versions/2_0_0/component.go similarity index 98% rename from lib/components/versions/2_0_0/component.go rename to pkg/lib/components/versions/2_0_0/component.go index 05de905b..b5d651f4 100644 --- a/lib/components/versions/2_0_0/component.go +++ b/pkg/lib/components/versions/2_0_0/component.go @@ -2,7 +2,7 @@ package component import ( "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" ) // Component struct is an individual component requiring documentation diff --git a/lib/components/versions/2_0_0/component_test.go b/pkg/lib/components/versions/2_0_0/component_test.go similarity index 97% rename from lib/components/versions/2_0_0/component_test.go rename to pkg/lib/components/versions/2_0_0/component_test.go index d9931598..715556da 100644 --- a/lib/components/versions/2_0_0/component_test.go +++ b/pkg/lib/components/versions/2_0_0/component_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/stretchr/testify/assert" ) diff --git a/lib/components/versions/3_0_0/component.go b/pkg/lib/components/versions/3_0_0/component.go similarity index 98% rename from lib/components/versions/3_0_0/component.go rename to pkg/lib/components/versions/3_0_0/component.go index 533b301c..4687428c 100644 --- a/lib/components/versions/3_0_0/component.go +++ b/pkg/lib/components/versions/3_0_0/component.go @@ -2,7 +2,7 @@ package component import ( "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" ) // Component struct is an individual component requiring documentation diff --git a/lib/components/versions/3_0_0/component_test.go b/pkg/lib/components/versions/3_0_0/component_test.go similarity index 97% rename from lib/components/versions/3_0_0/component_test.go rename to pkg/lib/components/versions/3_0_0/component_test.go index 1e402022..07b8badc 100644 --- a/lib/components/versions/3_0_0/component_test.go +++ b/pkg/lib/components/versions/3_0_0/component_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/stretchr/testify/assert" ) diff --git a/lib/components/versions/3_1_0/component.go b/pkg/lib/components/versions/3_1_0/component.go similarity index 99% rename from lib/components/versions/3_1_0/component.go rename to pkg/lib/components/versions/3_1_0/component.go index a29c72f0..a9cdc64b 100644 --- a/lib/components/versions/3_1_0/component.go +++ b/pkg/lib/components/versions/3_1_0/component.go @@ -4,7 +4,7 @@ import ( "sort" "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "gopkg.in/fatih/set.v0" ) diff --git a/lib/components/versions/3_1_0/component_test.go b/pkg/lib/components/versions/3_1_0/component_test.go similarity index 98% rename from lib/components/versions/3_1_0/component_test.go rename to pkg/lib/components/versions/3_1_0/component_test.go index 04416ee6..d8a3fda9 100644 --- a/lib/components/versions/3_1_0/component_test.go +++ b/pkg/lib/components/versions/3_1_0/component_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/stretchr/testify/assert" ) diff --git a/lib/components_test.go b/pkg/lib/components_test.go similarity index 89% rename from lib/components_test.go rename to pkg/lib/components_test.go index c5f0bd4d..913cd14b 100644 --- a/lib/components_test.go +++ b/pkg/lib/components_test.go @@ -4,8 +4,8 @@ import ( "path/filepath" "testing" - "github.com/opencontrol/compliance-masonry/lib/common/mocks" - "github.com/opencontrol/compliance-masonry/lib/result" + "github.com/opencontrol/compliance-masonry/pkg/lib/common/mocks" + "github.com/opencontrol/compliance-masonry/pkg/lib/result" "github.com/stretchr/testify/assert" ) @@ -46,7 +46,7 @@ func TestCompareAndAddComponent(t *testing.T) { func TestLoadSameComponentTwice(t *testing.T) { ws := localWorkspace{components: newComponents(), justifications: result.NewJustifications()} - componentPath := filepath.Join("..", "fixtures", "component_fixtures", "v3_1_0", "EC2") + componentPath := filepath.Join("..", "..", "test", "fixtures", "component_fixtures", "v3_1_0", "EC2") err := ws.LoadComponent(componentPath) // Should load the component without a problem. assert.Nil(t, err) diff --git a/lib/opencontrol/README.md b/pkg/lib/opencontrol/README.md similarity index 89% rename from lib/opencontrol/README.md rename to pkg/lib/opencontrol/README.md index 8e83b29e..eaed4ffd 100644 --- a/lib/opencontrol/README.md +++ b/pkg/lib/opencontrol/README.md @@ -29,8 +29,8 @@ When adding a new schema version. (in this example we will add v2.0.0 - Alias the import so that you can easily refer to the particular version. ``` import ( - v1_0_0 "github.com/opencontrol/compliance-masonry/lib/opencontrol/versions/1.0.0" - v2_0_0 "github.com/opencontrol/compliance-masonry/lib/opencontrol/versions/1.0.0" + v1_0_0 "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol/versions/1.0.0" + v2_0_0 "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol/versions/1.0.0" ) ``` - Now it should call the parse function that your schema version has. diff --git a/lib/opencontrol/mocks/SchemaParser.go b/pkg/lib/opencontrol/mocks/SchemaParser.go similarity index 91% rename from lib/opencontrol/mocks/SchemaParser.go rename to pkg/lib/opencontrol/mocks/SchemaParser.go index 5c51c6c3..c6186e6a 100644 --- a/lib/opencontrol/mocks/SchemaParser.go +++ b/pkg/lib/opencontrol/mocks/SchemaParser.go @@ -1,7 +1,7 @@ package mocks import ( - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/stretchr/testify/mock" ) diff --git a/lib/opencontrol/opencontrol.go b/pkg/lib/opencontrol/opencontrol.go similarity index 89% rename from lib/opencontrol/opencontrol.go rename to pkg/lib/opencontrol/opencontrol.go index f1e77768..c40d2bea 100644 --- a/lib/opencontrol/opencontrol.go +++ b/pkg/lib/opencontrol/opencontrol.go @@ -1,7 +1,7 @@ package opencontrol import ( - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" ) // Base is the common struct that all schemas must have. diff --git a/lib/opencontrol/opencontrol_suite_test.go b/pkg/lib/opencontrol/opencontrol_suite_test.go similarity index 100% rename from lib/opencontrol/opencontrol_suite_test.go rename to pkg/lib/opencontrol/opencontrol_suite_test.go diff --git a/lib/opencontrol/opencontrol_test.go b/pkg/lib/opencontrol/opencontrol_test.go similarity index 100% rename from lib/opencontrol/opencontrol_test.go rename to pkg/lib/opencontrol/opencontrol_test.go diff --git a/lib/opencontrol/parse.go b/pkg/lib/opencontrol/parse.go similarity index 90% rename from lib/opencontrol/parse.go rename to pkg/lib/opencontrol/parse.go index b6948e26..e2e954b3 100644 --- a/lib/opencontrol/parse.go +++ b/pkg/lib/opencontrol/parse.go @@ -3,8 +3,8 @@ package opencontrol import ( "errors" "github.com/blang/semver" - "github.com/opencontrol/compliance-masonry/lib/common" - v1_0_0 "github.com/opencontrol/compliance-masonry/lib/opencontrol/versions/1.0.0" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + v1_0_0 "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol/versions/1.0.0" "gopkg.in/yaml.v2" ) diff --git a/lib/opencontrol/parse_test.go b/pkg/lib/opencontrol/parse_test.go similarity index 93% rename from lib/opencontrol/parse_test.go rename to pkg/lib/opencontrol/parse_test.go index a3fa6733..dbcaccb9 100644 --- a/lib/opencontrol/parse_test.go +++ b/pkg/lib/opencontrol/parse_test.go @@ -1,12 +1,12 @@ package opencontrol_test import ( - . "github.com/opencontrol/compliance-masonry/lib/opencontrol" + . "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol" . "github.com/onsi/ginkgo" - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/opencontrol/mocks" - "github.com/opencontrol/compliance-masonry/lib/opencontrol/versions/1.0.0" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol/mocks" + "github.com/opencontrol/compliance-masonry/pkg/lib/opencontrol/versions/1.0.0" "github.com/stretchr/testify/assert" ) diff --git a/lib/opencontrol/versions/1.0.0/1.0.0_suite_test.go b/pkg/lib/opencontrol/versions/1.0.0/1.0.0_suite_test.go similarity index 100% rename from lib/opencontrol/versions/1.0.0/1.0.0_suite_test.go rename to pkg/lib/opencontrol/versions/1.0.0/1.0.0_suite_test.go diff --git a/lib/opencontrol/versions/1.0.0/opencontrol.go b/pkg/lib/opencontrol/versions/1.0.0/opencontrol.go similarity index 98% rename from lib/opencontrol/versions/1.0.0/opencontrol.go rename to pkg/lib/opencontrol/versions/1.0.0/opencontrol.go index eeee5875..dcbac334 100644 --- a/lib/opencontrol/versions/1.0.0/opencontrol.go +++ b/pkg/lib/opencontrol/versions/1.0.0/opencontrol.go @@ -1,7 +1,7 @@ package schema import ( - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/opencontrol/compliance-masonry/tools/constants" ) diff --git a/lib/opencontrol/versions/1.0.0/opencontrol_test.go b/pkg/lib/opencontrol/versions/1.0.0/opencontrol_test.go similarity index 97% rename from lib/opencontrol/versions/1.0.0/opencontrol_test.go rename to pkg/lib/opencontrol/versions/1.0.0/opencontrol_test.go index b3c3d7fc..a463e5ed 100644 --- a/lib/opencontrol/versions/1.0.0/opencontrol_test.go +++ b/pkg/lib/opencontrol/versions/1.0.0/opencontrol_test.go @@ -5,7 +5,7 @@ import ( . "github.com/onsi/ginkgo/extensions/table" "github.com/stretchr/testify/assert" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/opencontrol/compliance-masonry/tools/constants" ) diff --git a/lib/result/justifications.go b/pkg/lib/result/justifications.go similarity index 97% rename from lib/result/justifications.go rename to pkg/lib/result/justifications.go index e9fc5a36..0c192f56 100644 --- a/lib/result/justifications.go +++ b/pkg/lib/result/justifications.go @@ -3,7 +3,7 @@ package result import ( "sync" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" ) // Justifications struct contains the mapping that links controls to specific components diff --git a/lib/result/justifications_test.go b/pkg/lib/result/justifications_test.go similarity index 100% rename from lib/result/justifications_test.go rename to pkg/lib/result/justifications_test.go diff --git a/lib/standards.go b/pkg/lib/standards.go similarity index 92% rename from lib/standards.go rename to pkg/lib/standards.go index 69289fe2..117427a4 100644 --- a/lib/standards.go +++ b/pkg/lib/standards.go @@ -3,8 +3,8 @@ package lib import ( "sync" - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/standards" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/standards" ) // standardsMap struct is a thread save mapping of Standards diff --git a/lib/standards/standard.go b/pkg/lib/standards/standard.go similarity index 75% rename from lib/standards/standard.go rename to pkg/lib/standards/standard.go index 34931f7e..4c4529e2 100644 --- a/lib/standards/standard.go +++ b/pkg/lib/standards/standard.go @@ -1,8 +1,8 @@ package standards import ( - "github.com/opencontrol/compliance-masonry/lib/common" - v1_0_0 "github.com/opencontrol/compliance-masonry/lib/standards/versions/1_0_0" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + v1_0_0 "github.com/opencontrol/compliance-masonry/pkg/lib/standards/versions/1_0_0" "gopkg.in/yaml.v2" "io/ioutil" ) diff --git a/lib/standards/standard_test.go b/pkg/lib/standards/standard_test.go similarity index 72% rename from lib/standards/standard_test.go rename to pkg/lib/standards/standard_test.go index 5ce3ca8d..afd9084d 100644 --- a/lib/standards/standard_test.go +++ b/pkg/lib/standards/standard_test.go @@ -4,8 +4,8 @@ import ( "path/filepath" "testing" - "github.com/opencontrol/compliance-masonry/lib/common" - v1_0_0 "github.com/opencontrol/compliance-masonry/lib/standards/versions/1_0_0" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + v1_0_0 "github.com/opencontrol/compliance-masonry/pkg/lib/standards/versions/1_0_0" ) type v1standardsTest struct { @@ -16,9 +16,9 @@ type v1standardsTest struct { var standardsTests = []v1standardsTest{ // Check loading a standard that has 328 controls - {filepath.Join("..", "..", "fixtures", "opencontrol_fixtures", "standards", "NIST-800-53.yaml"), v1_0_0.Standard{Name: "NIST-800-53"}, 328}, + {filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures", "standards", "NIST-800-53.yaml"), v1_0_0.Standard{Name: "NIST-800-53"}, 328}, // Check loading a standard that has 258 controls - {filepath.Join("..", "..", "fixtures", "opencontrol_fixtures", "standards", "PCI-DSS-MAY-2015.yaml"), v1_0_0.Standard{Name: "PCI-DSS-MAY-2015"}, 258}, + {filepath.Join("..", "..", "..", "test", "fixtures", "opencontrol_fixtures", "standards", "PCI-DSS-MAY-2015.yaml"), v1_0_0.Standard{Name: "PCI-DSS-MAY-2015"}, 258}, } func TestLoadStandard(t *testing.T) { @@ -48,7 +48,7 @@ var standardTestErrors = []standardTestError{ // Check the error loading a file that doesn't exist {"", common.ErrReadFile}, // Check the error loading a file that has a broken schema - {filepath.Join("..", "..", "fixtures", "standards_fixtures", "BrokenStandard", "NIST-800-53.yaml"), common.ErrStandardSchema}, + {filepath.Join("..", "..", "..", "test", "fixtures", "standards_fixtures", "BrokenStandard", "NIST-800-53.yaml"), common.ErrStandardSchema}, } func TestLoadStandardsErrors(t *testing.T) { diff --git a/lib/standards/versions/1_0_0/standard.go b/pkg/lib/standards/versions/1_0_0/standard.go similarity index 96% rename from lib/standards/versions/1_0_0/standard.go rename to pkg/lib/standards/versions/1_0_0/standard.go index 62983619..177bfbb7 100644 --- a/lib/standards/versions/1_0_0/standard.go +++ b/pkg/lib/standards/versions/1_0_0/standard.go @@ -3,7 +3,7 @@ package standard import ( "sort" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "vbom.ml/util/sortorder" ) diff --git a/lib/standards/versions/1_0_0/standard_test.go b/pkg/lib/standards/versions/1_0_0/standard_test.go similarity index 100% rename from lib/standards/versions/1_0_0/standard_test.go rename to pkg/lib/standards/versions/1_0_0/standard_test.go diff --git a/lib/standards_test.go b/pkg/lib/standards_test.go similarity index 85% rename from lib/standards_test.go rename to pkg/lib/standards_test.go index 4b393643..4182e626 100644 --- a/lib/standards_test.go +++ b/pkg/lib/standards_test.go @@ -1,8 +1,8 @@ package lib import ( - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/common/mocks" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common/mocks" "github.com/stretchr/testify/assert" "testing" ) diff --git a/lib/workspace.go b/pkg/lib/workspace.go similarity index 96% rename from lib/workspace.go rename to pkg/lib/workspace.go index 48c8fac7..3b8b30f6 100644 --- a/lib/workspace.go +++ b/pkg/lib/workspace.go @@ -8,8 +8,8 @@ import ( "sync" "github.com/codegangsta/cli" - "github.com/opencontrol/compliance-masonry/lib/common" - "github.com/opencontrol/compliance-masonry/lib/result" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/result" ) // localWorkspace struct combines components, standards, and a certification data diff --git a/lib/workspace_test.go b/pkg/lib/workspace_test.go similarity index 86% rename from lib/workspace_test.go rename to pkg/lib/workspace_test.go index e624bd8d..dafb58b2 100644 --- a/lib/workspace_test.go +++ b/pkg/lib/workspace_test.go @@ -2,7 +2,7 @@ package lib import ( "errors" - "github.com/opencontrol/compliance-masonry/lib/common" + "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/stretchr/testify/assert" "path/filepath" "testing" @@ -64,8 +64,8 @@ func TestGetKey(t *testing.T) { var loadDataTests = []loadDataTest{ // Load a fixtures that has 2 component, 2 standards, and a certification called LATO { - filepath.Join("..", "fixtures", "opencontrol_fixtures"), - filepath.Join("..", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), + filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures"), + filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures", "certifications", "LATO.yaml"), []string{"NIST-800-53", "PCI-DSS-MAY-2015"}, 2, 1, "LATO"}, } @@ -91,7 +91,7 @@ func TestLoadData(t *testing.T) { var loadComponentsTests = []loadComponentsTest{ // Check loading set components that only has one component - {filepath.Join("..", "fixtures", "opencontrol_fixtures", "components"), 1}, + {filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures", "components"), 1}, } func TestLoadComponents(t *testing.T) { @@ -108,8 +108,8 @@ func TestLoadComponents(t *testing.T) { var loadComponentsTestErrors = []loadComponentsTestError{ { - filepath.Join("..", "fixtures", "opencontrol_fixtures", "missing"), - errors.New("Error: Unable to read the directory " + filepath.Join("..", "fixtures", "opencontrol_fixtures", "missing")), + filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures", "missing"), + errors.New("Error: Unable to read the directory " + filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures", "missing")), }, } @@ -127,7 +127,7 @@ func TestLoadComponentErrors(t *testing.T) { var loadStandardsTests = []loadStandardsTest{ // Load a series of standards file that have 2 standards { - filepath.Join("..", "fixtures", "opencontrol_fixtures", "standards"), + filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures", "standards"), []string{"NIST-800-53", "PCI-DSS-MAY-2015"}, }, } @@ -146,8 +146,8 @@ func TestLoadStandards(t *testing.T) { var loadStandardsTestErrors = []loadStandardsTestError{ { - filepath.Join("..", "fixtures", "opencontrol_fixtures", "missing"), - errors.New("Error: Unable to read the directory " + filepath.Join("..", "fixtures", "opencontrol_fixtures", "missing")), + filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures", "missing"), + errors.New("Error: Unable to read the directory " + filepath.Join("..", "..", "test", "fixtures", "opencontrol_fixtures", "missing")), }, } diff --git a/fixtures/component_fixtures/common/EC2BrokenControl/component.yaml b/test/fixtures/component_fixtures/common/EC2BrokenControl/component.yaml similarity index 100% rename from fixtures/component_fixtures/common/EC2BrokenControl/component.yaml rename to test/fixtures/component_fixtures/common/EC2BrokenControl/component.yaml diff --git a/fixtures/component_fixtures/common/EC2UnsupportedVersion/component.yaml b/test/fixtures/component_fixtures/common/EC2UnsupportedVersion/component.yaml similarity index 100% rename from fixtures/component_fixtures/common/EC2UnsupportedVersion/component.yaml rename to test/fixtures/component_fixtures/common/EC2UnsupportedVersion/component.yaml diff --git a/fixtures/component_fixtures/common/EC2VersionNotSemver/component.yaml b/test/fixtures/component_fixtures/common/EC2VersionNotSemver/component.yaml similarity index 100% rename from fixtures/component_fixtures/common/EC2VersionNotSemver/component.yaml rename to test/fixtures/component_fixtures/common/EC2VersionNotSemver/component.yaml diff --git a/fixtures/component_fixtures/common/EC2_InvalidFieldTypeForVersion2_0/component.yaml b/test/fixtures/component_fixtures/common/EC2_InvalidFieldTypeForVersion2_0/component.yaml similarity index 100% rename from fixtures/component_fixtures/common/EC2_InvalidFieldTypeForVersion2_0/component.yaml rename to test/fixtures/component_fixtures/common/EC2_InvalidFieldTypeForVersion2_0/component.yaml diff --git a/fixtures/component_fixtures/v2_0_0/EC2/component.yaml b/test/fixtures/component_fixtures/v2_0_0/EC2/component.yaml similarity index 100% rename from fixtures/component_fixtures/v2_0_0/EC2/component.yaml rename to test/fixtures/component_fixtures/v2_0_0/EC2/component.yaml diff --git a/fixtures/component_fixtures/v2_0_0/EC2WithKey/component.yaml b/test/fixtures/component_fixtures/v2_0_0/EC2WithKey/component.yaml similarity index 100% rename from fixtures/component_fixtures/v2_0_0/EC2WithKey/component.yaml rename to test/fixtures/component_fixtures/v2_0_0/EC2WithKey/component.yaml diff --git a/fixtures/component_fixtures/v3_0_0/EC2/component.yaml b/test/fixtures/component_fixtures/v3_0_0/EC2/component.yaml similarity index 100% rename from fixtures/component_fixtures/v3_0_0/EC2/component.yaml rename to test/fixtures/component_fixtures/v3_0_0/EC2/component.yaml diff --git a/fixtures/component_fixtures/v3_0_0/EC2WithKey/component.yaml b/test/fixtures/component_fixtures/v3_0_0/EC2WithKey/component.yaml similarity index 100% rename from fixtures/component_fixtures/v3_0_0/EC2WithKey/component.yaml rename to test/fixtures/component_fixtures/v3_0_0/EC2WithKey/component.yaml diff --git a/fixtures/component_fixtures/v3_1_0/EC2/component.yaml b/test/fixtures/component_fixtures/v3_1_0/EC2/component.yaml similarity index 100% rename from fixtures/component_fixtures/v3_1_0/EC2/component.yaml rename to test/fixtures/component_fixtures/v3_1_0/EC2/component.yaml diff --git a/fixtures/component_fixtures/v3_1_0/EC2WithKey/component.yaml b/test/fixtures/component_fixtures/v3_1_0/EC2WithKey/component.yaml similarity index 100% rename from fixtures/component_fixtures/v3_1_0/EC2WithKey/component.yaml rename to test/fixtures/component_fixtures/v3_1_0/EC2WithKey/component.yaml diff --git a/fixtures/exports_fixtures/complete_export/README.md b/test/fixtures/exports_fixtures/complete_export/README.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/README.md rename to test/fixtures/exports_fixtures/complete_export/README.md diff --git a/fixtures/exports_fixtures/complete_export/SUMMARY.md b/test/fixtures/exports_fixtures/complete_export/SUMMARY.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/SUMMARY.md rename to test/fixtures/exports_fixtures/complete_export/SUMMARY.md diff --git a/fixtures/exports_fixtures/complete_export/components/EC2.md b/test/fixtures/exports_fixtures/complete_export/components/EC2.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/components/EC2.md rename to test/fixtures/exports_fixtures/complete_export/components/EC2.md diff --git a/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC-2.md b/test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC-2.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC-2.md rename to test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC-2.md diff --git a/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC-6.md b/test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC-6.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC-6.md rename to test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC-6.md diff --git a/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC.md b/test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC.md rename to test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC.md diff --git a/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM-2.md b/test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM-2.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM-2.md rename to test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM-2.md diff --git a/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM.md b/test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM.md rename to test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM.md diff --git a/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.1.md b/test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.1.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.1.md rename to test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.1.md diff --git a/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.md b/test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.md rename to test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.md diff --git a/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.md b/test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.md rename to test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.md diff --git a/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.1.md b/test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.1.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.1.md rename to test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.1.md diff --git a/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.md b/test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.md similarity index 100% rename from fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.md rename to test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/README.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/README.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/README.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/README.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/SUMMARY.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/SUMMARY.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/SUMMARY.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/SUMMARY.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/components/EC2.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/components/EC2.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/components/EC2.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/components/EC2.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-2.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-2.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-2.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-2.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-6.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-6.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-6.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-6.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM-2.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM-2.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM-2.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM-2.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.1.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.1.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.1.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.1.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.1.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.1.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.1.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.1.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.md diff --git a/fixtures/exports_fixtures/complete_export_with_markdown/system_documentation/about-the-ssp.md b/test/fixtures/exports_fixtures/complete_export_with_markdown/system_documentation/about-the-ssp.md similarity index 100% rename from fixtures/exports_fixtures/complete_export_with_markdown/system_documentation/about-the-ssp.md rename to test/fixtures/exports_fixtures/complete_export_with_markdown/system_documentation/about-the-ssp.md diff --git a/fixtures/exports_fixtures/gitbook_exports/components_readme.md b/test/fixtures/exports_fixtures/gitbook_exports/components_readme.md similarity index 100% rename from fixtures/exports_fixtures/gitbook_exports/components_readme.md rename to test/fixtures/exports_fixtures/gitbook_exports/components_readme.md diff --git a/fixtures/exports_fixtures/gitbook_exports/general_readme.md b/test/fixtures/exports_fixtures/gitbook_exports/general_readme.md similarity index 100% rename from fixtures/exports_fixtures/gitbook_exports/general_readme.md rename to test/fixtures/exports_fixtures/gitbook_exports/general_readme.md diff --git a/fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-AC.md b/test/fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-AC.md similarity index 100% rename from fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-AC.md rename to test/fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-AC.md diff --git a/fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-CM.md b/test/fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-CM.md similarity index 100% rename from fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-CM.md rename to test/fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-CM.md diff --git a/fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-1.md b/test/fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-1.md similarity index 100% rename from fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-1.md rename to test/fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-1.md diff --git a/fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-2.md b/test/fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-2.md similarity index 100% rename from fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-2.md rename to test/fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-2.md diff --git a/fixtures/exports_fixtures/gitbook_exports/standards_readme.md b/test/fixtures/exports_fixtures/gitbook_exports/standards_readme.md similarity index 100% rename from fixtures/exports_fixtures/gitbook_exports/standards_readme.md rename to test/fixtures/exports_fixtures/gitbook_exports/standards_readme.md diff --git a/fixtures/opencontrol_fixtures/certifications/LATO.yaml b/test/fixtures/opencontrol_fixtures/certifications/LATO.yaml similarity index 100% rename from fixtures/opencontrol_fixtures/certifications/LATO.yaml rename to test/fixtures/opencontrol_fixtures/certifications/LATO.yaml diff --git a/fixtures/opencontrol_fixtures/components/EC2/artifact-ec2-1.png b/test/fixtures/opencontrol_fixtures/components/EC2/artifact-ec2-1.png similarity index 100% rename from fixtures/opencontrol_fixtures/components/EC2/artifact-ec2-1.png rename to test/fixtures/opencontrol_fixtures/components/EC2/artifact-ec2-1.png diff --git a/fixtures/opencontrol_fixtures/components/EC2/component.yaml b/test/fixtures/opencontrol_fixtures/components/EC2/component.yaml similarity index 100% rename from fixtures/opencontrol_fixtures/components/EC2/component.yaml rename to test/fixtures/opencontrol_fixtures/components/EC2/component.yaml diff --git a/fixtures/opencontrol_fixtures/standards/NIST-800-53.yaml b/test/fixtures/opencontrol_fixtures/standards/NIST-800-53.yaml similarity index 100% rename from fixtures/opencontrol_fixtures/standards/NIST-800-53.yaml rename to test/fixtures/opencontrol_fixtures/standards/NIST-800-53.yaml diff --git a/fixtures/opencontrol_fixtures/standards/PCI-DSS-MAY-2015.yaml b/test/fixtures/opencontrol_fixtures/standards/PCI-DSS-MAY-2015.yaml similarity index 100% rename from fixtures/opencontrol_fixtures/standards/PCI-DSS-MAY-2015.yaml rename to test/fixtures/opencontrol_fixtures/standards/PCI-DSS-MAY-2015.yaml diff --git a/fixtures/opencontrol_fixtures_complete/certifications/LATO.yaml b/test/fixtures/opencontrol_fixtures_complete/certifications/LATO.yaml similarity index 100% rename from fixtures/opencontrol_fixtures_complete/certifications/LATO.yaml rename to test/fixtures/opencontrol_fixtures_complete/certifications/LATO.yaml diff --git a/fixtures/opencontrol_fixtures_complete/components/EC2/artifact-ec2-1.png b/test/fixtures/opencontrol_fixtures_complete/components/EC2/artifact-ec2-1.png similarity index 100% rename from fixtures/opencontrol_fixtures_complete/components/EC2/artifact-ec2-1.png rename to test/fixtures/opencontrol_fixtures_complete/components/EC2/artifact-ec2-1.png diff --git a/fixtures/opencontrol_fixtures_complete/components/EC2/component.yaml b/test/fixtures/opencontrol_fixtures_complete/components/EC2/component.yaml similarity index 100% rename from fixtures/opencontrol_fixtures_complete/components/EC2/component.yaml rename to test/fixtures/opencontrol_fixtures_complete/components/EC2/component.yaml diff --git a/fixtures/opencontrol_fixtures_complete/standards/NIST-800-53.yaml b/test/fixtures/opencontrol_fixtures_complete/standards/NIST-800-53.yaml similarity index 100% rename from fixtures/opencontrol_fixtures_complete/standards/NIST-800-53.yaml rename to test/fixtures/opencontrol_fixtures_complete/standards/NIST-800-53.yaml diff --git a/fixtures/opencontrol_fixtures_complete/standards/PCI-DSS-MAY-2015.yaml b/test/fixtures/opencontrol_fixtures_complete/standards/PCI-DSS-MAY-2015.yaml similarity index 100% rename from fixtures/opencontrol_fixtures_complete/standards/PCI-DSS-MAY-2015.yaml rename to test/fixtures/opencontrol_fixtures_complete/standards/PCI-DSS-MAY-2015.yaml diff --git a/fixtures/opencontrol_fixtures_with_markdown/certifications/LATO.yaml b/test/fixtures/opencontrol_fixtures_with_markdown/certifications/LATO.yaml similarity index 100% rename from fixtures/opencontrol_fixtures_with_markdown/certifications/LATO.yaml rename to test/fixtures/opencontrol_fixtures_with_markdown/certifications/LATO.yaml diff --git a/fixtures/opencontrol_fixtures_with_markdown/components/EC2/artifact-ec2-1.png b/test/fixtures/opencontrol_fixtures_with_markdown/components/EC2/artifact-ec2-1.png similarity index 100% rename from fixtures/opencontrol_fixtures_with_markdown/components/EC2/artifact-ec2-1.png rename to test/fixtures/opencontrol_fixtures_with_markdown/components/EC2/artifact-ec2-1.png diff --git a/fixtures/opencontrol_fixtures_with_markdown/components/EC2/component.yaml b/test/fixtures/opencontrol_fixtures_with_markdown/components/EC2/component.yaml similarity index 100% rename from fixtures/opencontrol_fixtures_with_markdown/components/EC2/component.yaml rename to test/fixtures/opencontrol_fixtures_with_markdown/components/EC2/component.yaml diff --git a/fixtures/opencontrol_fixtures_with_markdown/markdowns/SUMMARY.md b/test/fixtures/opencontrol_fixtures_with_markdown/markdowns/SUMMARY.md similarity index 100% rename from fixtures/opencontrol_fixtures_with_markdown/markdowns/SUMMARY.md rename to test/fixtures/opencontrol_fixtures_with_markdown/markdowns/SUMMARY.md diff --git a/fixtures/opencontrol_fixtures_with_markdown/markdowns/system_documentation/about-the-ssp.md b/test/fixtures/opencontrol_fixtures_with_markdown/markdowns/system_documentation/about-the-ssp.md similarity index 100% rename from fixtures/opencontrol_fixtures_with_markdown/markdowns/system_documentation/about-the-ssp.md rename to test/fixtures/opencontrol_fixtures_with_markdown/markdowns/system_documentation/about-the-ssp.md diff --git a/fixtures/opencontrol_fixtures_with_markdown/standards/NIST-800-53.yaml b/test/fixtures/opencontrol_fixtures_with_markdown/standards/NIST-800-53.yaml similarity index 100% rename from fixtures/opencontrol_fixtures_with_markdown/standards/NIST-800-53.yaml rename to test/fixtures/opencontrol_fixtures_with_markdown/standards/NIST-800-53.yaml diff --git a/fixtures/opencontrol_fixtures_with_markdown/standards/PCI-DSS-MAY-2015.yaml b/test/fixtures/opencontrol_fixtures_with_markdown/standards/PCI-DSS-MAY-2015.yaml similarity index 100% rename from fixtures/opencontrol_fixtures_with_markdown/standards/PCI-DSS-MAY-2015.yaml rename to test/fixtures/opencontrol_fixtures_with_markdown/standards/PCI-DSS-MAY-2015.yaml diff --git a/fixtures/standards_fixtures/BrokenStandard/NIST-800-53.yaml b/test/fixtures/standards_fixtures/BrokenStandard/NIST-800-53.yaml similarity index 100% rename from fixtures/standards_fixtures/BrokenStandard/NIST-800-53.yaml rename to test/fixtures/standards_fixtures/BrokenStandard/NIST-800-53.yaml