lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nixosTests.beanstalkd: migrate to runTest (#395299)

authored by

Pol Dellaiera and committed by
GitHub
6c2aa3ef edb38909

+40 -42
+1 -1
nixos/tests/all-tests.nix
··· 228 228 babeld = runTest ./babeld.nix; 229 229 bazarr = runTest ./bazarr.nix; 230 230 bcachefs = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./bcachefs.nix; 231 - beanstalkd = handleTest ./beanstalkd.nix { }; 231 + beanstalkd = runTest ./beanstalkd.nix; 232 232 bees = handleTest ./bees.nix { }; 233 233 benchexec = handleTest ./benchexec.nix { }; 234 234 binary-cache = runTest {
+39 -41
nixos/tests/beanstalkd.nix
··· 1 - import ./make-test-python.nix ( 2 - { pkgs, lib, ... }: 1 + { pkgs, lib, ... }: 3 2 4 - let 5 - pythonEnv = pkgs.python3.withPackages (p: [ p.beanstalkc ]); 3 + let 4 + pythonEnv = pkgs.python3.withPackages (p: [ p.beanstalkc ]); 6 5 7 - produce = pkgs.writeScript "produce.py" '' 8 - #!${pythonEnv.interpreter} 9 - import beanstalkc 6 + produce = pkgs.writeScript "produce.py" '' 7 + #!${pythonEnv.interpreter} 8 + import beanstalkc 10 9 11 - queue = beanstalkc.Connection(host='localhost', port=11300, parse_yaml=False); 12 - queue.put(b'this is a job') 13 - queue.put(b'this is another job') 14 - ''; 10 + queue = beanstalkc.Connection(host='localhost', port=11300, parse_yaml=False); 11 + queue.put(b'this is a job') 12 + queue.put(b'this is another job') 13 + ''; 15 14 16 - consume = pkgs.writeScript "consume.py" '' 17 - #!${pythonEnv.interpreter} 18 - import beanstalkc 15 + consume = pkgs.writeScript "consume.py" '' 16 + #!${pythonEnv.interpreter} 17 + import beanstalkc 19 18 20 - queue = beanstalkc.Connection(host='localhost', port=11300, parse_yaml=False); 19 + queue = beanstalkc.Connection(host='localhost', port=11300, parse_yaml=False); 21 20 22 - job = queue.reserve(timeout=0) 23 - print(job.body.decode('utf-8')) 24 - job.delete() 25 - ''; 21 + job = queue.reserve(timeout=0) 22 + print(job.body.decode('utf-8')) 23 + job.delete() 24 + ''; 26 25 27 - in 28 - { 29 - name = "beanstalkd"; 30 - meta.maintainers = [ lib.maintainers.aanderse ]; 26 + in 27 + { 28 + name = "beanstalkd"; 29 + meta.maintainers = [ lib.maintainers.aanderse ]; 31 30 32 - nodes.machine = 33 - { ... }: 34 - { 35 - services.beanstalkd.enable = true; 36 - }; 31 + nodes.machine = 32 + { ... }: 33 + { 34 + services.beanstalkd.enable = true; 35 + }; 37 36 38 - testScript = '' 39 - start_all() 37 + testScript = '' 38 + start_all() 40 39 41 - machine.wait_for_unit("beanstalkd.service") 40 + machine.wait_for_unit("beanstalkd.service") 42 41 43 - machine.succeed("${produce}") 44 - assert "this is a job\n" == machine.succeed( 45 - "${consume}" 46 - ) 47 - assert "this is another job\n" == machine.succeed( 48 - "${consume}" 49 - ) 50 - ''; 51 - } 52 - ) 42 + machine.succeed("${produce}") 43 + assert "this is a job\n" == machine.succeed( 44 + "${consume}" 45 + ) 46 + assert "this is another job\n" == machine.succeed( 47 + "${consume}" 48 + ) 49 + ''; 50 + }