Make DB Switchable

Fixes races conditions and make the DB Switchable. Also prepare inside
the CompilationSpec the tree of the deps to be built, and parallelize
only the building jobs.

Closes #7

Signed-off-by: Ettore Di Giacinto <mudler@gentoo.org>
This commit is contained in:
Ettore Di Giacinto
2019-11-16 00:38:07 +01:00
committed by Ettore Di Giacinto
parent 6dada5622d
commit b2060c82e3
17 changed files with 231 additions and 147 deletions

View File

@@ -33,7 +33,7 @@ import (
var _ = Describe("Docker backend", func() {
Context("Simple Docker backend satisfies main interface functionalities", func() {
It("Builds and generate tars", func() {
generalRecipe := tree.NewGeneralRecipe()
generalRecipe := tree.NewGeneralRecipe(pkg.NewInMemoryDatabase(false))
err := generalRecipe.Load("../../../tests/fixtures/buildtree")
Expect(err).ToNot(HaveOccurred())
@@ -41,7 +41,7 @@ var _ = Describe("Docker backend", func() {
Expect(len(generalRecipe.Tree().GetPackageSet().GetPackages())).To(Equal(1))
compiler := NewLuetCompiler(nil, generalRecipe.Tree())
compiler := NewLuetCompiler(nil, generalRecipe.Tree(), generalRecipe.Tree().GetPackageSet())
spec, err := compiler.FromPackage(&pkg.DefaultPackage{Name: "enman", Category: "app-admin", Version: "1.4.0"})
Expect(err).ToNot(HaveOccurred())