Skip to content

Commit

Permalink
update documentation for spack load example
Browse files Browse the repository at this point in the history
remove the output from the `buildtest inspect query` command when showing results for the spack load example
  • Loading branch information
shahzebsiddiqui committed Aug 9, 2023
1 parent 4ec2d19 commit f5ec3e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 28 deletions.
2 changes: 1 addition & 1 deletion buildtest/tools/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 9 additions & 5 deletions docs/buildspecs/spack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
23 changes: 1 addition & 22 deletions docs/buildtest_tutorial_examples/spack/inspect/spack_load.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <http://gnu.org/licenses/gpl.html>.
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
Expand Down

0 comments on commit f5ec3e6

Please sign in to comment.