| OLD | NEW |
| 1 // Copyright 2017 The LUCI Authors. All rights reserved. | 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package venv | 5 package venv |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "encoding/json" | 8 "encoding/json" |
| 9 "fmt" | 9 "fmt" |
| 10 "io/ioutil" | 10 "io/ioutil" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 So(v.Delete(c), ShouldBeNil) | 172 So(v.Delete(c), ShouldBeNil) |
| 173 return nil | 173 return nil |
| 174 }) | 174 }) |
| 175 So(err, ShouldBeNil) | 175 So(err, ShouldBeNil) |
| 176 })) | 176 })) |
| 177 } | 177 } |
| 178 | 178 |
| 179 func TestVirtualEnv(t *testing.T) { | 179 func TestVirtualEnv(t *testing.T) { |
| 180 t.Parallel() | 180 t.Parallel() |
| 181 | 181 |
| 182 // TODO(dnj): Identify flake and fix. | |
| 183 t.Skip("Test is currently flaky, will re-enable once resolved.") | |
| 184 | |
| 185 for _, tc := range []struct { | 182 for _, tc := range []struct { |
| 186 name string | 183 name string |
| 187 ri *resolvedInterpreter | 184 ri *resolvedInterpreter |
| 188 }{ | 185 }{ |
| 189 {"python27", python27}, | 186 {"python27", python27}, |
| 190 {"python3", python3}, | 187 {"python3", python3}, |
| 191 } { | 188 } { |
| 192 tc := tc | 189 tc := tc |
| 193 | 190 |
| 194 t.Run(fmt.Sprintf(`Testing Virtualenv for: %s`, tc.name), func(t
*testing.T) { | 191 t.Run(fmt.Sprintf(`Testing Virtualenv for: %s`, tc.name), func(t
*testing.T) { |
| 195 testVirtualEnvWith(t, tc.ri) | 192 testVirtualEnvWith(t, tc.ri) |
| 196 }) | 193 }) |
| 197 } | 194 } |
| 198 } | 195 } |
| 199 | 196 |
| 200 func loadJSON(path string, dst interface{}) error { | 197 func loadJSON(path string, dst interface{}) error { |
| 201 content, err := ioutil.ReadFile(path) | 198 content, err := ioutil.ReadFile(path) |
| 202 if err != nil { | 199 if err != nil { |
| 203 return errors.Annotate(err).Reason("failed to open file").Err() | 200 return errors.Annotate(err).Reason("failed to open file").Err() |
| 204 } | 201 } |
| 205 if err := json.Unmarshal(content, dst); err != nil { | 202 if err := json.Unmarshal(content, dst); err != nil { |
| 206 return errors.Annotate(err).Reason("failed to unmarshal JSON").E
rr() | 203 return errors.Annotate(err).Reason("failed to unmarshal JSON").E
rr() |
| 207 } | 204 } |
| 208 return nil | 205 return nil |
| 209 } | 206 } |
| OLD | NEW |