@@ -177,11 +177,8 @@ describe('.getOTPVersion(_) - Erlang', () => {
177177 'https://repo.hex.pm, https://cdn.jsdelivr.net/hex' ,
178178 { multiline : true } ,
179179 )
180- const previousRunnerArch = process . env . RUNNER_ARCH
181180
182181 if ( process . platform === 'linux' ) {
183- process . env . RUNNER_ARCH = 'X64'
184-
185182 it ( 'is Ok for known linux version' , async ( ) => {
186183 before = simulateInput ( 'version-type' , 'strict' )
187184 spec = '27.0'
@@ -199,21 +196,21 @@ describe('.getOTPVersion(_) - Erlang', () => {
199196 assert . deepStrictEqual ( got , expected )
200197 simulateInput ( 'version-type' , before )
201198
202- spec = '19 .3.x'
203- osVersion = 'ubuntu-16 .04'
204- expected = 'OTP-19 .3.6.13 '
199+ spec = '20 .3.x'
200+ osVersion = 'ubuntu-20 .04'
201+ expected = 'OTP-20 .3.8.26 '
205202 got = await setupBeam . getOTPVersion ( spec , osVersion )
206203 assert . deepStrictEqual ( got , expected )
207204
208- spec = '^19 .3.6 '
209- osVersion = 'ubuntu-16 .04'
210- expected = 'OTP-19 .3.6.13 '
205+ spec = '^20 .3.8 '
206+ osVersion = 'ubuntu-20 .04'
207+ expected = 'OTP-20 .3.8.26 '
211208 got = await setupBeam . getOTPVersion ( spec , osVersion )
212209 assert . deepStrictEqual ( got , expected )
213210
214- spec = '^19 .3'
215- osVersion = 'ubuntu-18 .04'
216- expected = 'OTP-19 .3.6.13 '
211+ spec = '^20 .3'
212+ osVersion = 'ubuntu-20 .04'
213+ expected = 'OTP-20 .3.8.26 '
217214 got = await setupBeam . getOTPVersion ( spec , osVersion )
218215 assert . deepStrictEqual ( got , expected )
219216
@@ -309,6 +306,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
309306 if ( process . platform === 'linux' ) {
310307 it ( 'is main-... only if strict/maint-... is used as input' , async ( ) => {
311308 const arm64Options = setupBeam . githubARMRunnerArchs ( )
309+ const previousRunnerArch = process . env . RUNNER_ARCH
312310 process . env . RUNNER_ARCH =
313311 arm64Options [ Math . floor ( Math . random ( ) * arm64Options . length ) ]
314312
@@ -344,6 +342,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
344342
345343 it ( 'is Ok for known linux ARM64 version' , async ( ) => {
346344 const arm64Options = setupBeam . githubARMRunnerArchs ( )
345+ const previousRunnerArch = process . env . RUNNER_ARCH
347346 process . env . RUNNER_ARCH =
348347 arm64Options [ Math . floor ( Math . random ( ) * arm64Options . length ) ]
349348
@@ -404,10 +403,13 @@ describe('.getOTPVersion(_) - Erlang', () => {
404403 expected = 'master'
405404 got = await setupBeam . getOTPVersion ( spec , osVersion )
406405 assert . deepStrictEqual ( got , expected )
406+
407+ process . env . RUNNER_ARCH = previousRunnerArch
407408 } )
408409
409410 it ( 'is Ok for known linux AMD64 version' , async ( ) => {
410411 const amd64Options = setupBeam . githubAMDRunnerArchs ( )
412+ const previousRunnerArch = process . env . RUNNER_ARCH
411413 process . env . RUNNER_ARCH =
412414 amd64Options [ Math . floor ( Math . random ( ) * amd64Options . length ) ]
413415
@@ -486,12 +488,15 @@ describe('.getOTPVersion(_) - Erlang', () => {
486488 expected = 'master'
487489 got = await setupBeam . getOTPVersion ( spec , osVersion )
488490 assert . deepStrictEqual ( got , expected )
491+
492+ process . env . RUNNER_ARCH = previousRunnerArch
489493 } )
490494 }
491495
492496 if ( process . platform === 'darwin' ) {
493497 it ( 'is main-... only if strict/maint-... is used as input' , async ( ) => {
494498 const arm64Options = setupBeam . githubARMRunnerArchs ( )
499+ const previousRunnerArch = process . env . RUNNER_ARCH
495500 process . env . RUNNER_ARCH =
496501 arm64Options [ Math . floor ( Math . random ( ) * arm64Options . length ) ]
497502
@@ -521,6 +526,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
521526
522527 it ( 'is Ok for known macos ARM64 version' , async ( ) => {
523528 const arm64Options = setupBeam . githubARMRunnerArchs ( )
529+ const previousRunnerArch = process . env . RUNNER_ARCH
524530 process . env . RUNNER_ARCH =
525531 arm64Options [ Math . floor ( Math . random ( ) * arm64Options . length ) ]
526532
@@ -531,10 +537,13 @@ describe('.getOTPVersion(_) - Erlang', () => {
531537 got = await setupBeam . getOTPVersion ( spec , osVersion )
532538 assert . deepStrictEqual ( got , expected )
533539 simulateInput ( 'version-type' , before )
540+
541+ process . env . RUNNER_ARCH = previousRunnerArch
534542 } )
535543
536544 it ( 'is Ok for known macos AMD64 version' , async ( ) => {
537545 const amd64Options = setupBeam . githubARMRunnerArchs ( )
546+ const previousRunnerArch = process . env . RUNNER_ARCH
538547 process . env . RUNNER_ARCH =
539548 amd64Options [ Math . floor ( Math . random ( ) * amd64Options . length ) ]
540549
@@ -545,11 +554,12 @@ describe('.getOTPVersion(_) - Erlang', () => {
545554 got = await setupBeam . getOTPVersion ( spec , osVersion )
546555 assert . deepStrictEqual ( got , expected )
547556 simulateInput ( 'version-type' , before )
557+
558+ process . env . RUNNER_ARCH = previousRunnerArch
548559 } )
549560 }
550561
551562 simulateInput ( 'hexpm-mirrors' , hexMirrors , { multiline : true } )
552- process . env . RUNNER_ARCH = previousRunnerArch
553563} )
554564
555565describe ( 'OTP arch-specific install' , ( ) => {
@@ -572,6 +582,7 @@ describe('OTP arch-specific install', () => {
572582 `Fetching OTP Version with invalid Github runner architecture is supposed to fail` ,
573583 )
574584 }
585+
575586 process . env . RUNNER_ARCH = previousRunnerArch
576587 } )
577588} )
@@ -582,11 +593,8 @@ describe('.getOTPVersion(_) - Elixir', () => {
582593 let spec
583594 let otpVersion
584595 let before
585- const previousRunnerArch = process . env . RUNNER_ARCH
586596
587597 if ( process . platform === 'linux' ) {
588- process . env . RUNNER_ARCH = 'X64'
589-
590598 it ( 'returns the expected value' , async ( ) => {
591599 spec = '1.18.x'
592600 otpVersion = 'OTP-27'
@@ -644,8 +652,6 @@ describe('.getOTPVersion(_) - Elixir', () => {
644652 simulateInput ( 'version-type' , before )
645653 } )
646654 }
647-
648- process . env . RUNNER_ARCH = previousRunnerArch
649655} )
650656
651657describe ( '.getOTPVersion(_) - Gleam' , ( ) => {
0 commit comments