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

Commit c4e11d0

Browse files
committed
Fix breaking integration tests & add new testcase
- Adds single line console output when GOPATH is searched for projects. - Fixes breaking integration tests due to new default init behavior (Network mode). - Adds a new integration test harness_tests/init/case4 for newtwork mode.
1 parent b9395aa commit c4e11d0

File tree

9 files changed

+69
-3
lines changed

9 files changed

+69
-3
lines changed

cmd/dep/init.go

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
125125
var pd projectData
126126

127127
if cmd.gopath {
128+
fmt.Fprintln(os.Stderr, "Searching GOPATH for projects...")
128129
pd, err = getProjectData(ctx, pkgT, cpr, sm)
129130
if err != nil {
130131
return err

cmd/dep/testdata/harness_tests/init/case1/testcase.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"commands": [
3-
["init", "-no-examples"]
3+
["init", "-no-examples", "-gopath"]
44
],
55
"gopath-initial": {
66
"github.com/sdboyer/deptest": "v0.8.0",

cmd/dep/testdata/harness_tests/init/case2/testcase.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"commands": [
3-
["init", "-no-examples"]
3+
["init", "-no-examples", "-gopath"]
44
],
55
"gopath-initial": {
66
"github.com/sdboyer/deptest": "v0.8.0"

cmd/dep/testdata/harness_tests/init/case3/testcase.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"commands": [
3-
["init", "-no-examples"]
3+
["init", "-no-examples", "-gopath"]
44
],
55
"gopath-initial": {
66
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"

cmd/dep/testdata/harness_tests/init/case4/final/Gopkg.lock

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
[[dependencies]]
3+
name = "github.com/sdboyer/deptest"
4+
version = "^1.0.0"
5+
6+
[[dependencies]]
7+
name = "github.com/sdboyer/deptestdos"
8+
version = "^2.0.0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2017 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package foo
6+
7+
import "github.com/sdboyer/deptest"
8+
9+
func Foo() deptest.Foo {
10+
var y deptest.Foo
11+
12+
return y
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2017 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/golang/notexist/foo"
11+
"github.com/sdboyer/deptestdos"
12+
)
13+
14+
func main() {
15+
var x deptestdos.Bar
16+
y := foo.FooFunc()
17+
18+
fmt.Println(x, y)
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"commands": [
3+
["init", "-no-examples"]
4+
],
5+
"gopath-initial": {
6+
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
7+
},
8+
"vendor-final": [
9+
"github.com/sdboyer/deptest",
10+
"github.com/sdboyer/deptestdos"
11+
]
12+
}

0 commit comments

Comments
 (0)