@@ -37,7 +37,7 @@ import (
37
37
func TestArduinoCliDaemon (t * testing.T ) {
38
38
// See: https://github.com/arduino/arduino-cli/pull/1804
39
39
40
- env , cli := createEnvForDaemon (t )
40
+ env , cli := integrationtest . CreateEnvForDaemon (t )
41
41
defer env .CleanUp ()
42
42
43
43
grpcInst := cli .Create ()
@@ -96,7 +96,7 @@ func TestArduinoCliDaemon(t *testing.T) {
96
96
func TestDaemonAutoUpdateIndexOnFirstInit (t * testing.T ) {
97
97
// https://github.com/arduino/arduino-cli/issues/1529
98
98
99
- env , cli := createEnvForDaemon (t )
99
+ env , cli := integrationtest . CreateEnvForDaemon (t )
100
100
defer env .CleanUp ()
101
101
102
102
grpcInst := cli .Create ()
@@ -110,26 +110,11 @@ func TestDaemonAutoUpdateIndexOnFirstInit(t *testing.T) {
110
110
require .FileExists (t , cli .DataDir ().Join ("package_index.json" ).String ())
111
111
}
112
112
113
- // createEnvForDaemon performs the minimum required operations to start the arduino-cli daemon.
114
- // It returns a testsuite.Environment and an ArduinoCLI client to perform the integration tests.
115
- // The Environment must be disposed by calling the CleanUp method via defer.
116
- func createEnvForDaemon (t * testing.T ) (* integrationtest.Environment , * integrationtest.ArduinoCLI ) {
117
- env := integrationtest .NewEnvironment (t )
118
-
119
- cli := integrationtest .NewArduinoCliWithinEnvironment (env , & integrationtest.ArduinoCLIConfig {
120
- ArduinoCLIPath : integrationtest .FindRepositoryRootPath (t ).Join ("arduino-cli" ),
121
- UseSharedStagingFolder : true ,
122
- })
123
-
124
- _ = cli .StartDaemon (false )
125
- return env , cli
126
- }
127
-
128
113
func TestDaemonCompileOptions (t * testing.T ) {
129
114
// See: https://github.com/arduino/arduino-cli/issues/1614
130
115
// See: https://github.com/arduino/arduino-cli/pull/1820
131
116
132
- env , cli := createEnvForDaemon (t )
117
+ env , cli := integrationtest . CreateEnvForDaemon (t )
133
118
defer env .CleanUp ()
134
119
135
120
grpcInst := cli .Create ()
@@ -203,7 +188,7 @@ func TestDaemonCompileOptions(t *testing.T) {
203
188
func TestDaemonCompileAfterFailedLibInstall (t * testing.T ) {
204
189
// See: https://github.com/arduino/arduino-cli/issues/1812
205
190
206
- env , cli := createEnvForDaemon (t )
191
+ env , cli := integrationtest . CreateEnvForDaemon (t )
207
192
defer env .CleanUp ()
208
193
209
194
grpcInst := cli .Create ()
@@ -233,7 +218,7 @@ func TestDaemonCompileAfterFailedLibInstall(t *testing.T) {
233
218
}
234
219
235
220
func TestDaemonCoreUpdateIndex (t * testing.T ) {
236
- env , cli := createEnvForDaemon (t )
221
+ env , cli := integrationtest . CreateEnvForDaemon (t )
237
222
defer env .CleanUp ()
238
223
239
224
grpcInst := cli .Create ()
@@ -269,7 +254,7 @@ func TestDaemonCoreUpdateIndex(t *testing.T) {
269
254
}
270
255
271
256
func TestDaemonBundleLibInstall (t * testing.T ) {
272
- env , cli := createEnvForDaemon (t )
257
+ env , cli := integrationtest . CreateEnvForDaemon (t )
273
258
defer env .CleanUp ()
274
259
275
260
grpcInst := cli .Create ()
@@ -409,7 +394,7 @@ func TestDaemonLibrariesRescanOnInstall(t *testing.T) {
409
394
with the gprc instance
410
395
The last attempt is expected to not raise an error
411
396
*/
412
- env , cli := createEnvForDaemon (t )
397
+ env , cli := integrationtest . CreateEnvForDaemon (t )
413
398
defer env .CleanUp ()
414
399
415
400
grpcInst := cli .Create ()
@@ -465,7 +450,7 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) {
465
450
466
451
t .Run ("upgraded successfully with additional urls" , func (t * testing.T ) {
467
452
t .Run ("and install.json is present" , func (t * testing.T ) {
468
- env , cli := createEnvForDaemon (t )
453
+ env , cli := integrationtest . CreateEnvForDaemon (t )
469
454
defer env .CleanUp ()
470
455
471
456
grpcInst := cli .Create ()
@@ -481,7 +466,7 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) {
481
466
require .False (t , platform .GetRelease ().GetMissingMetadata ()) // install.json is present
482
467
})
483
468
t .Run ("and install.json is missing" , func (t * testing.T ) {
484
- env , cli := createEnvForDaemon (t )
469
+ env , cli := integrationtest . CreateEnvForDaemon (t )
485
470
defer env .CleanUp ()
486
471
487
472
grpcInst := cli .Create ()
@@ -504,7 +489,7 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) {
504
489
505
490
t .Run ("upgrade failed" , func (t * testing.T ) {
506
491
t .Run ("without additional URLs" , func (t * testing.T ) {
507
- env , cli := createEnvForDaemon (t )
492
+ env , cli := integrationtest . CreateEnvForDaemon (t )
508
493
defer env .CleanUp ()
509
494
510
495
grpcInst := cli .Create ()
@@ -524,7 +509,7 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) {
524
509
require .False (t , platform .GetRelease ().GetMissingMetadata ()) // install.json is present
525
510
})
526
511
t .Run ("missing both additional URLs and install.json" , func (t * testing.T ) {
527
- env , cli := createEnvForDaemon (t )
512
+ env , cli := integrationtest . CreateEnvForDaemon (t )
528
513
defer env .CleanUp ()
529
514
530
515
grpcInst := cli .Create ()
0 commit comments