1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[32232],{4094:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>o,contentTitle:()=>l,default:()=>h,frontMatter:()=>d,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"guides/dev/testing","title":"Running SST tests","description":"SST Core includes two test utilities sst-test-core and sst-test-elements. These are python-based utilities built on the unittest module and modified for SST. The code for this framework resides in sst-core/src/sst/core/testingframework/. Pull request and nightly jobs that run tests on Core, Elements, or third-party element libraries, do so by using this framework to locate and run test suites. The utilities are nearly identical and references to one in this guide apply to both unless otherwise stated.","source":"@site/../docs/guides/dev/testing.md","sourceDirName":"guides/dev","slug":"/guides/dev/testing","permalink":"/sst-docs/docs/guides/dev/testing","draft":false,"unlisted":false,"editUrl":"https://github.com/sstsimulator/sst-docs/edit/master/docs/../docs/guides/dev/testing.md","tags":[],"version":"current","lastUpdatedBy":"grvosku","lastUpdatedAt":1779202020000,"frontMatter":{"title":"Running SST tests"},"sidebar":"guides","previous":{"title":"AutoTesting","permalink":"/sst-docs/docs/guides/dev/autotest"},"next":{"title":"Testing FAQ","permalink":"/sst-docs/docs/guides/dev/testfaq"}}');var r=s(74848),i=s(28453);const d={title:"Running SST tests"},l=void 0,o={},c=[{value:"Core testing",id:"core-testing",level:3},{value:"Elements testing",id:"elements-testing",level:3},{value:"Test framework output",id:"test-framework-output",level:3},{value:"Test framework options",id:"test-framework-options",level:3},{value:"Examples",id:"examples",level:2},{value:"Run the Merlin tests",id:"run-the-merlin-tests",level:3},{value:"Run tests with 2 threads and 4 ranks",id:"run-tests-with-2-threads-and-4-ranks",level:3},{value:"Run the MemHierarchy tests concurrently",id:"run-the-memhierarchy-tests-concurrently",level:3},{value:"Run both core and elements tests and send output to the same directory",id:"run-both-core-and-elements-tests-and-send-output-to-the-same-directory",level:3},{value:"List all the test suites that can be found",id:"list-all-the-test-suites-that-can-be-found",level:3},{value:"More information",id:"more-information",level:2}];function a(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["SST Core includes two test utilities ",(0,r.jsx)(t.code,{children:"sst-test-core"})," and ",(0,r.jsx)(t.code,{children:"sst-test-elements"}),". These are python-based utilities built on the ",(0,r.jsx)(t.code,{children:"unittest"})," module and modified for SST. The code for this framework resides in ",(0,r.jsx)(t.code,{children:"sst-core/src/sst/core/testingframework/"}),". Pull request and nightly jobs that run tests on Core, Elements, or third-party element libraries, do so by using this framework to locate and run test suites. The utilities are nearly identical and references to one in this guide apply to both unless otherwise stated."]}),"\n",(0,r.jsx)(t.h3,{id:"core-testing",children:"Core testing"}),"\n",(0,r.jsxs)(t.p,{children:["After building and installing SST Core, tests can be run by invoking ",(0,r.jsx)(t.code,{children:"sst-test-core"}),". This utility runs all tests for SST Core and is the same as the set of tests run on Core for pull request and nightly testing."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"$ sst-test-core\n"})}),"\n",(0,r.jsx)(t.h3,{id:"elements-testing",children:"Elements testing"}),"\n",(0,r.jsxs)(t.p,{children:["Similar to Core, elements test suites (whether part of the SST-Elements repository or part of a separate element library and registered with Core), can be run using the ",(0,r.jsx)(t.code,{children:"sst-test-elements"})," utility. Both Core and at least one element library must be built and installed. Due to run time, some Elements tests are only run during nightly tests and not for pull-request testing. To run these, use the ",(0,r.jsx)(t.code,{children:"--categories"})," or equivalent ",(0,r.jsx)(t.code,{children:"-m"})," option."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"$ sst-test-elements # Run pull request tests\n$ sst-test-elements -m pr # Run pull request tests\n$ sst-test-elements -m pr nightly # Run nightly and pull request tests\n"})}),"\n",(0,r.jsx)(t.p,{children:"Unlike Core, the set of elements tests that are detected and run depends on which elements and dependencies have been installed and have registered their test suites with SST Core. Thus, replicating a particular SST job requires installing the same set of SST Elements and dependencies as the job does."}),"\n",(0,r.jsx)(t.h3,{id:"test-framework-output",children:"Test framework output"}),"\n",(0,r.jsxs)(t.p,{children:["Running either command above produces a folder, by default named ",(0,r.jsx)(t.code,{children:"sst_test_outputs"}),". This folder has three sub-folders as shown."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"$ sst-test-core\n$ ls sst_test_outputs\nrun_data\ttmp_data\txml_data\n"})}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"run_data"})," folder contains the test outputs produced by running the tests. ",(0,r.jsx)(t.code,{children:"tmp_data"})," holds intermediate files produced by some test suites during their post-processing of test outputs. The last folder, ",(0,r.jsx)(t.code,{children:"xml_data"}
1)," is used by the SST AutoTesting infrastructure for reporting and can generally be ignored when run locally."]}),"\n",(0,r.jsx)(t.h3,{id:"test-framework-options",children:"Test framework options"}),"\n",(0,r.jsxs)(t.p,{children:["Running either utility with ",(0,r.jsx)(t.code,{children:"-h"})," returns a detailed description of available options. The most common ones are listed here."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Option"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"-f"}),", ",(0,r.jsx)(t.code,{children:"--fail_fast"})]}),(0,r.jsx)(t.td,{children:"Stop testing immediately on a test failure"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"-o <DIR>"}),", ",(0,r.jsx)(t.code,{children:"--output <DIR>"})]}),(0,r.jsx)(t.td,{children:"Set the output directory to DIR"}),(0,r.jsx)(t.td,{children:"./sst_test_outputs"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"-k"}),", ",(0,r.jsx)(t.code,{children:"--keep_output"})]}),(0,r.jsx)(t.td,{children:"Do not overwrite the output directory, append to it instead"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"-c <N>"}),", ",(0,r.jsx)(t.code,{children:"--concurrent <N>"})]}),(0,r.jsx)(t.td,{children:"Run the test suites (not the individual tests) on N concurrent threads"}),(0,r.jsx)(t.td,{children:"1"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"-l"}),", ",(0,r.jsx)(t.code,{children:"--list_testsuites"})]}),(0,r.jsx)(t.td,{children:"List the discovered test suites instead of running them"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"-m"}),", ",(0,r.jsx)(t.code,{children:"--categories {pr,nightly,weekly} [{pr,nightly,weekly}]"})]}),(0,r.jsx)(t.td,{children:"Run tests belonging to the listed categories"}),(0,r.jsx)(t.td,{children:"pr"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"-r <N>"}),", ",(0,r.jsx)(t.code,{children:"--ranks <N>"})]}),(0,r.jsx)(t.td,{children:"Run SST with N ranks in each test"}),(0,r.jsx)(t.td,{children:"1"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"-t <N>"}),", ",(0,r.jsx)(t.code,{children:"--threads <N>"})]}),(0,r.jsx)(t.td,{children:"Run SST with N threads in each test"}),(0,r.jsx)(t.td,{children:"1"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"-w <STR>"})}),(0,r.jsxs)(t.td,{children:["Wildcard STR of test suite names to run. Use quotes to avoid automatic wildcard expansion. For example, ",(0,r.jsx)(t.code,{children:'-w "*merlin*"'})]}),(0,r.jsx)(t.td,{children:'"*"'})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"-e <STR>"})}),(0,r.jsx)(t.td,{children:"Run only the test named STR"}),(0,r.jsx)(t.td,{children:"run all tests"})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"examples",children:"Examples"}),"\n",(0,r.jsx)(t.h3,{id:"run-the-merlin-tests",children:"Run the Merlin tests"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:'$ sst-test-elements -w "*merlin*"\n'})}),"\n",(0,r.jsx)(t.h3,{id:"run-tests-with-2-threads-and-4-ranks",children:"Run tests with 2 threads and 4 ranks"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"$ sst-test-elements -t 2 -r 4\n"})}),"\n",(0,r.jsx)(t.h3,{id:"run-the-memhierarchy-tests-concurrently",children:"Run the MemHierarchy tests concurrently"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:'$ sst-test-elements -c 2 -w "*memH*"\n'})}),"\n",(0,r.jsx)(t.h3,{id:"run-both-core-and-elements-tests-and-send-output-to-the-same-directory",children:"Run both core and elements tests and send output to the same directory"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"$ sst-test-core\n$ sst-test-elements -k\n"})}),"\n",(0,r.jsx)(t.h3,{id:"list-all-the-test-suites-that-can-be-found",children:"List all the test suites that can be found"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"$ sst-test-elements -l\n"})}),"\n",(0,r.jsx)(t.h2,{id:"more-information",children:"More information"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"/sst-docs/docs/guides/dev/testframework",children:"Guide to writing test suites"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"/sst-docs/docs/guides/dev/testframeworkapi",children:"Test framework API"})}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},28453:(e,t,s)=>{s.d(t,{R:()=>d,x:()=>l});var n=s(96540);const r={},i=n.createContext(r);function d(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.