-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
Today, we have *three* Go modules in this repository: - / - schema/ - mantle/ And as of recently, both the toplevel / and mantle/ vendor the schema/. This causes "vendor amplification", where a vendored dependency of schema/ gets *triplicated*. Now that gangplank/ is out of the picture, it makes sense to move the bits from schema/ into the toplevel module. This really helps make operating on coreos-assembler stuff feel like a "first class" operation. Also, we no longer have two copies of the schema file!
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package cosa | ||
package builds | ||
|
||
import ( | ||
"bytes" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package builds | ||
|
||
import ( | ||
"io/ioutil" | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
) | ||
|
||
var testData = ` | ||
{ | ||
"schema-version": "1.0.0", | ||
"builds": [ | ||
{ | ||
"id": "32.20201030.dev.0", | ||
"arches": [ | ||
"x86_64" | ||
] | ||
} | ||
], | ||
"timestamp": "2020-10-30T16:45:21Z" | ||
} | ||
` | ||
|
||
func TestBuildsMeta(t *testing.T) { | ||
tmpd := t.TempDir() | ||
_ = os.MkdirAll(filepath.Join(tmpd, "builds"), 0755) | ||
|
||
bjson := filepath.Join(tmpd, CosaBuildsJSON) | ||
if err := ioutil.WriteFile(bjson, []byte(testData), 0666); err != nil { | ||
t.Fatalf("failed to write the test data %v", err) | ||
} | ||
|
||
b, err := getBuilds(tmpd) | ||
if err != nil { | ||
t.Fatalf("failed to find the builds") | ||
} | ||
if b == nil { | ||
t.Fatalf("builds should not be nil") | ||
} | ||
|
||
latest, ok := b.getLatest("x86_64") | ||
if !ok { | ||
t.Fatalf("x86_64 build should be available") | ||
} | ||
if latest != "32.20201030.dev.0" { | ||
t.Fatalf("build ID does not match") | ||
} | ||
} | ||
|
||
func TestCanArtifact(t *testing.T) { | ||
if !CanArtifact("aws") { | ||
t.Errorf("should be able to build AWS") | ||
} | ||
if CanArtifact("darkCloud") { | ||
t.Errorf("darkCloud is not a valid cloud") | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package cosa | ||
package builds | ||
|
||
import ( | ||
"encoding/json" | ||
|