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

Commit

Permalink
Fix breaking integration tests & add new testcase
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
darkowlzz committed May 2, 2017
1 parent b9395aa commit c4e11d0
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/dep/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
var pd projectData

if cmd.gopath {
fmt.Fprintln(os.Stderr, "Searching GOPATH for projects...")
pd, err = getProjectData(ctx, pkgT, cpr, sm)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/dep/testdata/harness_tests/init/case1/testcase.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"commands": [
["init", "-no-examples"]
["init", "-no-examples", "-gopath"]
],
"gopath-initial": {
"github.com/sdboyer/deptest": "v0.8.0",
Expand Down
2 changes: 1 addition & 1 deletion cmd/dep/testdata/harness_tests/init/case2/testcase.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"commands": [
["init", "-no-examples"]
["init", "-no-examples", "-gopath"]
],
"gopath-initial": {
"github.com/sdboyer/deptest": "v0.8.0"
Expand Down
2 changes: 1 addition & 1 deletion cmd/dep/testdata/harness_tests/init/case3/testcase.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"commands": [
["init", "-no-examples"]
["init", "-no-examples", "-gopath"]
],
"gopath-initial": {
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
Expand Down
13 changes: 13 additions & 0 deletions cmd/dep/testdata/harness_tests/init/case4/final/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions cmd/dep/testdata/harness_tests/init/case4/final/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

[[dependencies]]
name = "github.com/sdboyer/deptest"
version = "^1.0.0"

[[dependencies]]
name = "github.com/sdboyer/deptestdos"
version = "^2.0.0"
13 changes: 13 additions & 0 deletions cmd/dep/testdata/harness_tests/init/case4/initial/foo/bar.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package foo

import "github.com/sdboyer/deptest"

func Foo() deptest.Foo {
var y deptest.Foo

return y
}
19 changes: 19 additions & 0 deletions cmd/dep/testdata/harness_tests/init/case4/initial/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
"fmt"

"github.com/golang/notexist/foo"
"github.com/sdboyer/deptestdos"
)

func main() {
var x deptestdos.Bar
y := foo.FooFunc()

fmt.Println(x, y)
}
12 changes: 12 additions & 0 deletions cmd/dep/testdata/harness_tests/init/case4/testcase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"commands": [
["init", "-no-examples"]
],
"gopath-initial": {
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
]
}

0 comments on commit c4e11d0

Please sign in to comment.