File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](https://semver.org).
5
5
This changelog adheres to [ Keep a CHANGELOG] ( https://keepachangelog.com ) .
6
6
7
7
## [ Unreleased]
8
+ ### Fixed
9
+ - Use URI.parse when selecting the docker target
8
10
9
11
## [ 0.48.0] - 2024-04-16
10
12
### Added
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def select_target
40
40
extra_args = @platform . docker_run_args . nil? ? [ ] : @platform . docker_run_args
41
41
42
42
Vanagon ::Utilities . ex ( "#{ @docker_cmd } run -d --name #{ build_host_name } -builder #{ ssh_args } #{ extra_args . join ( ' ' ) } #{ @platform . docker_image } " )
43
- @target = URI . new ( 'localhost' )
43
+ @target = URI . parse ( 'localhost' )
44
44
45
45
wait_for_ssh unless @platform . use_docker_exec
46
46
rescue StandardError => e
Original file line number Diff line number Diff line change 101
101
end
102
102
end
103
103
end
104
+
105
+ describe '#select_target' do
106
+ context 'when platform has use_docker_exec set' do
107
+ subject { described_class . new ( platform_with_docker_exec ) }
108
+
109
+ it 'starts a new docker instance' do
110
+ expect ( Vanagon ::Utilities ) . to receive ( :ex ) . with ( "/usr/bin/docker run -d --name debian_10-slim-builder debian:10-slim" )
111
+
112
+ subject . select_target
113
+ end
114
+
115
+ it 'sets the target to a localhost URI' do
116
+ allow ( Vanagon ::Utilities ) . to receive ( :ex )
117
+
118
+ subject . select_target
119
+
120
+ uri = subject . target
121
+ expect ( uri ) . to be_an_instance_of ( URI ::Generic )
122
+ expect ( uri . path ) . to eq ( 'localhost' )
123
+ end
124
+ end
125
+ end
104
126
end
You can’t perform that action at this time.
0 commit comments