Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
  • Loading branch information
ibrasho committed Jun 2, 2017
1 parent e159914 commit 3a28237
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
12 changes: 6 additions & 6 deletions cmd/dep/ensure.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,19 @@ func (cmd *ensureCommand) Run(ctx *dep.Ctx, args []string) error {

solver, err := gps.Prepare(params, sm)
if err != nil {
return errors.Wrap(err, "ensure Prepare")
}

solution, err := solver.Solve()
if err != nil {
handleAllTheFailuresOfTheWorld(err)
if deduceErrs, ok := err.(gps.DeductionFailureErrs); ok {
ctx.Loggers.Err.Println("The following errors occurred while deducing packages:")
for ip, dErr := range deduceErrs {
ctx.Loggers.Err.Printf(" * \"%s\": %s", ip, dErr)
}
ctx.Loggers.Err.Println()
}
return errors.Wrap(err, "ensure Prepare")
}

solution, err := solver.Solve()
if err != nil {
handleAllTheFailuresOfTheWorld(err)
return errors.Wrap(err, "ensure Solve()")
}

Expand Down
38 changes: 37 additions & 1 deletion internal/gps/hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ func TestHashInputs(t *testing.T) {

s, err := Prepare(params, newdepspecSM(fix.ds, nil))
if err != nil {
if deduceErrs, ok := err.(DeductionFailureErrs); ok {
t.Error("The following errors occurred while deducing packages:")
for ip, dErr := range deduceErrs {
t.Errorf(" * \"%s\": %s", ip, dErr)
}
t.Error()
}
t.Fatalf("Unexpected error while prepping solver: %s", err)
}

Expand Down Expand Up @@ -80,6 +87,13 @@ func TestHashInputsReqsIgs(t *testing.T) {

s, err := Prepare(params, newdepspecSM(fix.ds, nil))
if err != nil {
if deduceErrs, ok := err.(DeductionFailureErrs); ok {
t.Error("The following errors occurred while deducing packages:")
for ip, dErr := range deduceErrs {
t.Errorf(" * \"%s\": %s", ip, dErr)
}
t.Error()
}
t.Fatalf("Unexpected error while prepping solver: %s", err)
}

Expand Down Expand Up @@ -122,6 +136,13 @@ func TestHashInputsReqsIgs(t *testing.T) {

s, err = Prepare(params, newdepspecSM(fix.ds, nil))
if err != nil {
if deduceErrs, ok := err.(DeductionFailureErrs); ok {
t.Error("The following errors occurred while deducing packages:")
for ip, dErr := range deduceErrs {
t.Errorf(" * \"%s\": %s", ip, dErr)
}
t.Error()
}
t.Fatalf("Unexpected error while prepping solver: %s", err)
}

Expand Down Expand Up @@ -162,6 +183,13 @@ func TestHashInputsReqsIgs(t *testing.T) {

s, err = Prepare(params, newdepspecSM(fix.ds, nil))
if err != nil {
if deduceErrs, ok := err.(DeductionFailureErrs); ok {
t.Error("The following errors occurred while deducing packages:")
for ip, dErr := range deduceErrs {
t.Errorf(" * \"%s\": %s", ip, dErr)
}
t.Error()
}
t.Fatalf("Unexpected error while prepping solver: %s", err)
}

Expand Down Expand Up @@ -528,7 +556,15 @@ func TestHashInputsOverrides(t *testing.T) {

s, err := Prepare(params, newdepspecSM(basefix.ds, nil))
if err != nil {
t.Fatalf("(fix: %q) Unexpected error while prepping solver: %s", fix.name, err)
if deduceErrs, ok := err.(DeductionFailureErrs); ok {
t.Error("The following errors occurred while deducing packages:")
for ip, dErr := range deduceErrs {
t.Errorf(" * \"%s\": %s", ip, dErr)
}
t.Error()
}
t.Errorf("(fix: %q) Unexpected error while prepping solver: %s", fix.name, err)
continue
}

h := sha256.New()
Expand Down

0 comments on commit 3a28237

Please sign in to comment.