Skip to content

Commit

Permalink
Merge pull request #1183 from dependabot/go-issue
Browse files Browse the repository at this point in the history
Go 1.12
  • Loading branch information
hmarr authored Jun 4, 2019
2 parents 024175e + 6de3b7f commit 6449ffe
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" >> /etc/ap
### GO

# Install Go and dep
RUN curl https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz | tar -xz -C /opt \
RUN curl https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz | tar -xz -C /opt \
&& wget -O /opt/go/bin/dep https://github.com/golang/dep/releases/download/0.5.2/dep-linux-amd64 \
&& chmod +x /opt/go/bin/dep \
&& mkdir /opt/go/gopath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def updated_go_sum_content

RESOLVABILITY_ERROR_REGEXES = [
/go: .*: git fetch .*: exit status 128/.freeze,
/go: verifying .*: checksum mismatch/.freeze,
/build .*: cannot find module for path/.freeze
/verifying .*: checksum mismatch/.freeze,
/build .*: cannot find module providing package/.freeze
].freeze
MODULE_PATH_MISMATCH_REGEXES = [
/go: ([^@\s]+)(?:@[^\s]+)?: .* has non-.* module path "(.*)" at/,
Expand Down
4 changes: 2 additions & 2 deletions go_modules/spec/dependabot/go_modules/file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
describe "parse" do
subject(:dependencies) { parser.parse }

its(:length) { is_expected.to eq(5) }
its(:length) { is_expected.to eq(6) }

describe "top level dependencies" do
subject(:dependencies) do
parser.parse.select(&:top_level?)
end

its(:length) { is_expected.to eq(2) }
its(:length) { is_expected.to eq(3) }

describe "a dependency that uses go modules" do
subject(:dependency) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@

it { is_expected.to include(%(rsc.io/quote v1.5.2\n)) }

context "for a go 1.11 go.mod" do
let(:go_mod_body) do
fixture("go_mods", go_mod_fixture_name).sub(/go 1.12/, "")
end
it { is_expected.to_not include("go 1.") }
end

context "for a go 1.12 go.mod" do
it { is_expected.to include("go 1.12") }
end

context "with a go.sum" do
let(:go_sum) do
Dependabot::DependencyFile.new(name: "go.sum", content: go_sum_body)
Expand Down
5 changes: 5 additions & 0 deletions go_modules/spec/fixtures/go_mods/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
module github.com/dependabot/vgotest

go 1.12

require (
// The actual repo is fatih/color, but including the capital
// helps us test that we preserve caps
github.com/fatih/Color v1.7.0
github.com/mattn/go-colorable v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
rsc.io/qr v0.1.0
rsc.io/quote v1.4.0
)

replace rsc.io/qr => github.com/rsc/qr v0.2.0
1 change: 1 addition & 0 deletions go_modules/spec/fixtures/go_mods/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
github.com/fatih/Color v1.7.0/go.mod h1:sh3dZUZxJqMHuwt2YwWXqUUIe6N9gJlzZZH0eFduGkw=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/rsc/qr v0.2.0/go.mod h1:IF+uZjkb9fqyeF/4tlBoynqmQxUoPfWEKh921coOuXs=
rsc.io/quote v1.4.0/go.mod h1:S2vMDfxMfk+OGQ7xf1uNqJCSuSPCW5QC127LHYfOJmQ=
rsc.io/sampler v1.0.0/go.mod h1:cqxpM3ZVz9VtirqxZPmrWzkQ+UkiNiGtkrN+B+i8kx8=

0 comments on commit 6449ffe

Please sign in to comment.