diff --git a/buildtest/tools/docs.py b/buildtest/tools/docs.py index 4998e88e1..86a536320 100644 --- a/buildtest/tools/docs.py +++ b/buildtest/tools/docs.py @@ -87,7 +87,7 @@ def build_spack_examples(autogen_dir): f"{inspect_dir}/remove_environment_example.txt": "buildtest inspect query --testpath remove_environment_automatically remove_environment_explicit", f"{inspect_dir}/pre_post_cmds.txt": "buildtest inspect query -o --testpath run_pre_post_commands", f"{inspect_dir}/mirror_example.txt": "buildtest inspect query -o --testpath add_mirror add_mirror_in_spack_env", - f"{inspect_dir}/spack_load.txt": "buildtest inspect query -o --testpath spack_load_example", + f"{inspect_dir}/spack_load.txt": "buildtest inspect query -t spack_load_example", f"{inspect_dir}/spack_test.txt": "buildtest inspect query -o --testpath spack_test_m4", f"{inspect_dir}/spack_test_specs.txt": "buildtest inspect query -o --testpath spack_test_results_specs_format", f"{inspect_dir}/spack_sbatch.txt": "buildtest inspect query --testpath spack_sbatch_example", diff --git a/docs/buildspecs/spack.rst b/docs/buildspecs/spack.rst index cb3d664d4..a829d3864 100644 --- a/docs/buildspecs/spack.rst +++ b/docs/buildspecs/spack.rst @@ -373,10 +373,13 @@ for buildtest to install spack in the environment. Loading Specs --------------- -We can load specs using ``spack load`` which can be used for running tests or simply loading the package once it is installed, -Let's say if we were to test ``m4``, we can load the package prior to testing it. The ``load`` refers to ``spack load`` and ``options`` refers to options -that can be passed to ``spack load`` command with a list of specs defined by ``specs`` property. The below command would translate to -``spack load --only package m4`` +We can load specs into our user environment via ``spack load`` which can be used for running tests or +simply loading the package once it is installed. In this next example, we will test ``m4`` package, +where we load the package first prior to testing it. The ``load`` refers to ``spack load`` and ``options`` +refers to command options passed to ``spack load`` command with a list of specs to load defined +by ``specs`` property. + +In this test, the command would translate to ``spack load --only package m4`` .. literalinclude:: ../../examples/spack/spack_load.yml :language: yaml @@ -388,6 +391,7 @@ Let's build this by running the following .. program-output:: cat buildtest_tutorial_examples/spack/build/spack_load.txt -.. dropdown:: ``buildtest inspect query -o --testpath spack_load_example`` +Let's take a look at the generated test, take note of the `spack load` command +.. dropdown:: ``buildtest inspect query -t spack_load_example`` .. program-output:: cat buildtest_tutorial_examples/spack/inspect/spack_load.txt diff --git a/docs/buildtest_tutorial_examples/spack/inspect/spack_load.txt b/docs/buildtest_tutorial_examples/spack/inspect/spack_load.txt index 4e5346f36..7fd2f7d6a 100644 --- a/docs/buildtest_tutorial_examples/spack/inspect/spack_load.txt +++ b/docs/buildtest_tutorial_examples/spack/inspect/spack_load.txt @@ -1,4 +1,4 @@ -$ buildtest inspect query -o --testpath spack_load_example +$ buildtest inspect query -t spack_load_example ───────────────────────────────────────────────────────── spack_load_example/60d45649-5ee2-4efd-978b-58b7bafbc10d ────────────────────────────────────────────────────────── Executor: generic.local.bash Description: Run spack load for m4 package and run tests @@ -13,27 +13,6 @@ Build Script: /home/spack/runs/generic.local.bash/spack_load/spack_load_example/ Output File: /home/spack/runs/generic.local.bash/spack_load/spack_load_example/60d45649/spack_load_example.out Error File: /home/spack/runs/generic.local.bash/spack_load/spack_load_example/60d45649/spack_load_example.err Log File: /home/spack/buildtest/var/logs/buildtest_hhrqf19o.log -────────────────────────────── Output File: /home/spack/runs/generic.local.bash/spack_load/spack_load_example/60d45649/spack_load_example.out ────────────────────────────── -==> Spack test 47fcdc7a-1994-4013-98c2-eba6d48e7103 -==> Testing package m4-1.4.18-mkc3u4x -==> Results for test suite '47fcdc7a-1994-4013-98c2-eba6d48e7103': -==> m4-1.4.18-mkc3u4x PASSED -==> Testing package m4-1.4.18-mkc3u4x -==> [2023-08-08-18:10:45.271339] test: ensuring m4 version is 1.4.18 -==> [2023-08-08-18:10:45.272816] '/home/spack/spack-workspace/software/linux-ubuntu18.04-x86_64/gcc-7.5.0/m4-1.4.18-mkc3u4x2p2wie6jfhuku7g5rkovcrxps/bin/m4' '--version' -m4 (GNU M4) 1.4.18 -Copyright (C) 2016 Free Software Foundation, Inc. -License GPLv3+: GNU GPL version 3 or later . -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. -Written by Rene' Seindal. -PASSED -==> [2023-08-08-18:10:45.282548] test: ensuring m4 example succeeds -==> [2023-08-08-18:10:45.282862] '/home/spack/spack-workspace/software/linux-ubuntu18.04-x86_64/gcc-7.5.0/m4-1.4.18-mkc3u4x2p2wie6jfhuku7g5rkovcrxps/bin/m4' '/home/spack/.s -// macro is defined -Hello, World! -PASSED - ─────────────────────────────── Test File: /home/spack/runs/generic.local.bash/spack_load/spack_load_example/60d45649/spack_load_example.sh ──────────────────────────────── #!/bin/bash source /home/spack/spack/share/spack/setup-env.sh