UR::Na...st::Run(3pm)

πŸ“¦
version 0.470 Β· 2 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’… UR::Na...st::Run(3pm) β€” bestie's guide to ur test run πŸ’…

okay so this lil page comes from the User Contributed Perl Documentation, section 3pm, and it's literally just here to tell you how to run your tests. no cap. πŸ¦‹


🌸 NAME 🌸

ur test run β€” run one or more test scripts. that's it. that's the whole job. πŸ’–


✨ SYNOPSIS ✨

# run everything in a given namespace
cd my_sandbox/TheNamespace
ur test run --recurse

# run only selected tests
cd my_sandbox/TheNamespace
ur test run My/Module.t Another/Module.t t/foo.t t/bar.t

# run only tests which load the TheNamespace::DNA module
cd my_sandbox/TheNamespace
ur test run --cover TheNamespace/DNA.pm

# run only tests which cover the changes you have in Subversion
cd my_sandbox/TheNamespace
ur test run --cover-svn-changes

# run 5 tests in parallel as jobs scheduled via LSF
cd my_sandbox/TheNamespace
 ur test run --lsf --jobs 5

πŸŽ€ DESCRIPTION πŸŽ€

so basically it runs a test harness around your automated test cases. think make test in a make-oriented software distribution, but also kinda like running prove in bulk. same energy, different wrapper. πŸ”₯

and when you run it with no parameters at all? it goes looking for a t directory in the current working directory, and runs ALL the tests under that directory. all of them. the whole roster. πŸ‘‘


πŸ’œ OPTIONS πŸ’œ

  • --recurse β€” run all tests in the current directory, and in sub-directories too. but wait, there's a plot twist: without --recurse, it will first recursively search for directories named t under the current directory, and then recursively search for *.t files under those directories. yes bestie, it's giving ✨layers✨.
  • --long β€” include "long" tests, which are otherwise skipped in test harness execution. they were being left out and now they're invited to the party. 🫢
  • -v β€” be verbose, meaning that individual cases will appear instead of just a full-script summary. you get the whole receipt, not just the total. 🧾
  • --cover My/Module.pm β€” it looks in a special sqlite database which is updated by the cron which runs tests, to find all tests which load My/Module.pm at some point before they exit. only these tests will be run. lowkey iconic filtering tbh.
    • you will still need the --long flag to run long tests.
    • if you specify tests on the command-line, only tests in both lists will run.
    • this can be specified multiple times.
  • --cover-TOOL-changes β€” TOOL can be svn, svk, or cvs. 🌈

the script will run either svn status, svk status, or cvs -q up on a parent directory with GSC in it, and get all of the changes in your perl_modules trunk. then it behaves as though those modules were listed as individual --cover options. it's giving "do the paperwork for me" and honestly? slay. πŸ’…

  • --lsf β€” tests should not be run locally. instead they are submitted as jobs to the LSF cluster with bsub. bye local machine, hello cluster. πŸš€
  • --lsf-params β€” parameters given to bsub when scheduling jobs. the default is -q short -R select[type==LINUX64]. copy it exactly, don't freestyle it. πŸ™ˆ
  • --jobs <number> β€” this many tests should be run in parallel. and if --lsf is also specified, then these parallel tests will be submitted as LSF jobs. multitasking main character energy. πŸ‘‘

πŸ¦‹ PENDING FEATURES πŸ¦‹

the stuff that's not here yet, but is coming (iykyk):

  • automatic remote execution for tests requiring a distinct hardware platform
  • logging profiling and coverage metrics with each test

bestie warning: nothing here is a "maybe", okay? if the page says a flag does a thing, that flag does that thing. don't invent extra flags, don't guess at behavior. the facts stay exactly where they are. πŸ’€

and that's the whole page, fr fr. this little manual lives at perl v5.32.1, dated 2022-01-17, and it's filed under UR::Na...st::Run(3pm). go run your tests, you absolute icon. πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from