Skip to content

Add spack test-suite command for posting combinatorial tests to CDash#2917

Closed
kielfriedt wants to merge 14 commits intodevelopfrom
wip
Closed

Add spack test-suite command for posting combinatorial tests to CDash#2917
kielfriedt wants to merge 14 commits intodevelopfrom
wip

Conversation

@kielfriedt
Copy link
Copy Markdown

Added testsuite which reads in a yaml file. Example yaml file is located in lib/spack/docs/tutorial/examples/. Changed dashboard to simple and complete versions. Current requirements are for build only, but in the future a complete configure, build and test would be needed. Testsuite is documented and tested.

@kielfriedt
Copy link
Copy Markdown
Author

I thought the changes from @hegner for cdash were merged. I guess I have a conflict on install.py

@tgamblin tgamblin changed the title Wip Add spack testsuite command for posting combinatorial tests to CDash Jan 24, 2017
@tgamblin
Copy link
Copy Markdown
Member

@kielfriedt: nope -- but they're in your branch, so they'll be included when we merge this.

Copy link
Copy Markdown
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kielfriedt: looks pretty good! Can you address the various inline comments and the following requests?

  1. Can you rename spack testsuite to spack test-suite -- to match the formatting of the other commands?
  2. Can you add docs on how to use the command and on the YAML format to the testing guide?
  3. flake8 is going to complain about formatting in cmd/teststuite.py so you'll need to fix the style errors. You can run spack flake8 locally to fix that. See the contributor guide

Get the list of compilers from spack found on the system.
Compares the spack list to test file.
If a compiler is found on both lists its returned.
'''
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be proper docstring, which goes inside the function after the def line.

See PEP257 or this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done



'''
fucntion Name: removeTests
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"fucntion"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to doc strings

pkg = ""
compiler=""
teststoRemove = []
if "%" in exclusion:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parse this stuff using the Spec constructor? It should make your life easier and you don't have to do all the string analysis.

You can just pass it a string, e.g.:

from spack.spec import Spec
spec = Spec('foo @1.0 %[email protected]')

Then you can do things like this:

print spec.satisfies('%clang@3')
>>> True

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure this is what I am doing. This is for exclusion, by doing the string analysis so I can determine how to properly test for the exclusion in the set of tests.

path = ""
dashboards = []
#designed to use a single file and modify the enabled tests, thus requiring a single file modification.
for files in args.yamlFile: #read yaml files which contains description of tests
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a singular variable name -- each element in args.yamlFile is a file, not a "files". 😄

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

for files in args.yamlFile: #read yaml files which contains description of tests
with open(files, 'r') as stream:
try:
yamlFile= yaml.load(stream)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert this to use spack.util.spack_yaml, e.g.:

import spack.util.spack_yaml as syaml
with open(file) as  stream:
    syaml.load(stream)

Spack's YAML adds support for a few nice things like line numbers (which you can use in error messages) and ordered dictionaries.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

args = parser.parse_args([cdash]) #use cdash-complete if you want configure, build and test output.
args.package = test
install.install(parser, args)
except Exception as ex:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever error occurs should probably go in the test log and get displayed as part of CDash output.

except Exception as ex:
template = "An exception of type {0} occured. Arguments:\n{1!r}"
message = template.format(type(ex).__name__, ex.args)
tty.msg(message)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of printing, put errors in the XML.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to look into this. cdash files are produced by logging. I am not sure I can put it into the xml file but ill figure it out.

buildName = buildName.split('=')
template.set('BuildName',str(buildName[0]) + " " + str(buildName[1]))
template.set('BuildStamp', self.buildstamp)
tempcompiler = self.spec.short_spec.split('%')[1].split(' ')[0]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid using split and use the actual fields on . e.g. self.spec.compiler.name, self.spec.compiler.version, etc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. Wasn't aware of that option.



def prepare_build_report(self):
report = self.create_template()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious whether the XML parts of this would be more maintainable if you just make an XML template with """, e.g.:

template = """\
<Build>
    <StartDateTime>{date}</StartDateTime>
    <StartDateTime>{log_text}</StartDateTime>
</Build>
"""
output = template.format(date=date, log_text=captured_output)

etc. You can get pretty far with Python's str.format() function.

What do you think? I think manually constructing the ElementTree is kind of tedious and hard to read or change.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done by @hegner I did not redo it. I just adjusted the format to get it to output a file that would display on cdash. I will talk with hegner for advice.

return decorator



Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too much space.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL done

@tgamblin tgamblin added tests General test capability(ies) commands labels Jan 24, 2017
@tgamblin tgamblin changed the title Add spack testsuite command for posting combinatorial tests to CDash Add spack test-suite command for posting combinatorial tests to CDash Jan 24, 2017
@kielfriedt
Copy link
Copy Markdown
Author

Add done with changes as requested and tested on my end.

@tgamblin
Copy link
Copy Markdown
Member

@kielfriedt: can you rebase this and/or merge current develop?

@kielfriedt
Copy link
Copy Markdown
Author

@tgamblin I am now using testing/wip_xsdk, I got rid of the wip branch. Should I make a new pull request?

@tgamblin
Copy link
Copy Markdown
Member

@kielfriedt: Well, you got rid of your local WIP branch, not the one on GitHub.

We want to keep these features separate from the xsdk ones, so that if we merge your feature first, it doesn't conflict with Barry's xsdk branch, or vice versa. When integrating stuff like this you should keep your changes on one branch, then make a new integration branch where you keep merging your feature branch and the one you want to integrate with.

It sounds like you should cherry-pick your work on the testing/wip_xsdk branch onto this one, and push to the wip branch on the server. Then the new stuff will show up on the PR.

Copy link
Copy Markdown
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kielfriedt: This is looking better! I added a bunch of comments Can you:

  1. Address the comments
  2. Fix the PEP8 and doc warnings

Nice work!

return spec, "PackageStillNeededError"
return spec, ""

def installSpec(spec,cdash,test):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use_this_format notThisOne

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

cdash = '--log-format=cdash-simple'

cdash_root = "/var/spack/cdash/"
enabledTests = []
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabled_tests

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

compilers = data['compilers']
exclusions = data['exclusions']
except:
tty.msg("Testing yaml files must contain atleast enable, packages, exclusions and compilers to produce results. Exclusions can be empty, IE []")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this warning unnecessary? The schema validation should ensure this never happens.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

},
},
},
'exclusions': {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclusions should be optional (might not want to exclude anything, and requiring [] is tedious for the user)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

'default': [],
'items': {'type': 'string'}
},
'dashboard': {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the dashboard ought to be optional, or maybe only specified at the command line.

Also, can you change this to use include and exclude instead of enable and exclusions? Each of those should take specs. Example:

spack-tests:
    dashboard: # optional string
    include:  # use this instead of "enable"
        # specs to include (any others are assumed excluded.  Default to all included)
    exclude: 
        # specs to exclude (from set of included specs)
    packages:
        # ...
    compilers:
        # ...
    dependencies:
        # TBD -- we need this, but ignore for now (we'll figure out how to factor in later)
    variants:
        # TBD -- need this too, but ignore for now.  not clear if it is global or if it's a per-package setting or both.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

help='using this option switches from simple cdash output to compelet: simple is only build, complete is configure, build and test xml output.')
subparser.add_argument(
'yamlFile', nargs=argparse.REMAINDER,
help="yaml file that contains a list of tests, example yaml file can be found in /lib/spack/docs/tutorial/examples/test.yaml")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file's really long and it's buried in the source -- I think we shouldn't assume that users can dig through the source directories. Can you remove the reference to the file and just say "see docs on test suites" for now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're adding a new command, can you add tab completion as well? It would look like:

function _spack_test-suite {
    if $list_options
    then
        compgen -W "-c --complete" -- "$cur"
    fi
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,2231 @@
---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file is too long -- if it's this long it should really just be generated. Can you just remove this and link to the docs in the command help where this is referenced?

Also, lib/spack/docs/tutorial/examples is really just for our SC'16 tutorial. Examples like this should probably get their own directory separate from that.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shortened and moved.

with versions. Using the enabled field will allow you to focus on specific packages.
To narrow down the scope of a package or compiler, you can use the exclusion field.

--Example of a yaml file---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call this a "test suite file" or a "test suite YAML file" or something more specific.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file format should start with a top-level key like other YAML files in Spack. Can you make it start with test-suite: or something, to identify the type of file to Spack?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the yaml file, use:

.. code-block:: yaml

and indent it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


dashboard: ["https://spack.io/cdash/submit.php?project=spack"]

path: "~/home/username"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output path should be a parameter of the command -- not a hard-coded value in the file. I think it should be possible to either specify an existing output directory on the command line, or to run without output and just spit the results out to a new directory within the current working dir, named, e.g., spack-tests-YYYY-MM-DD-timestamp. See spack mirror create for similar semantics.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timestamp = datetime.now().strftime("%Y-%m-%d")
directory = 'spack-mirror-' + timestamp

current output from dashboard is similar to this now.

@@ -0,0 +1,322 @@
#!/usr/bin/env python
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a license

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

help='using this option switches from simple cdash output to compelet: simple is only build, complete is configure, build and test xml output.')
subparser.add_argument(
'yamlFile', nargs=argparse.REMAINDER,
help="yaml file that contains a list of tests, example yaml file can be found in /lib/spack/docs/tutorial/examples/test.yaml")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're adding a new command, can you add tab completion as well? It would look like:

function _spack_test-suite {
    if $list_options
    then
        compgen -W "-c --complete" -- "$cur"
    fi
}

with versions. Using the enabled field will allow you to focus on specific packages.
To narrow down the scope of a package or compiler, you can use the exclusion field.

--Example of a yaml file---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the yaml file, use:

.. code-block:: yaml

and indent it.

data=mydata,
headers={'content-type':'text/plain'},
params={'file': cdash_path + file}
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 space indentation, not tabs.

Copy link
Copy Markdown
Author

@kielfriedt kielfriedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes have been completed


dashboard: ["https://spack.io/cdash/submit.php?project=spack"]

path: "~/home/username"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timestamp = datetime.now().strftime("%Y-%m-%d")
directory = 'spack-mirror-' + timestamp

current output from dashboard is similar to this now.

with versions. Using the enabled field will allow you to focus on specific packages.
To narrow down the scope of a package or compiler, you can use the exclusion field.

--Example of a yaml file---
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,2231 @@
---
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shortened and moved.

@@ -0,0 +1,322 @@
#!/usr/bin/env python
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

help='using this option switches from simple cdash output to compelet: simple is only build, complete is configure, build and test xml output.')
subparser.add_argument(
'yamlFile', nargs=argparse.REMAINDER,
help="yaml file that contains a list of tests, example yaml file can be found in /lib/spack/docs/tutorial/examples/test.yaml")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return spec, "PackageStillNeededError"
return spec, ""

def installSpec(spec,cdash,test):
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

cdash = '--log-format=cdash-simple'

cdash_root = "/var/spack/cdash/"
enabledTests = []
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

compilers = data['compilers']
exclusions = data['exclusions']
except:
tty.msg("Testing yaml files must contain atleast enable, packages, exclusions and compilers to produce results. Exclusions can be empty, IE []")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

},
},
},
'exclusions': {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

'default': [],
'items': {'type': 'string'}
},
'dashboard': {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@tgamblin
Copy link
Copy Markdown
Member

@adamjstewart: are you ok with these changes?

@@ -0,0 +1,22 @@
---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the --- for?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is the standard start of a YAML file (see http://yaml.org/), but all spack YAML files start with <name>:. We should change this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,22 @@
---
test-suite:
include: [ ape, atompaw, transset]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the space between [ and ape?

---
test-suite:
include: [ ape, atompaw, transset]
exclude: [binutils,tk]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a space after the comma?


$ spack install --log-format=junit <spec>

Per default the log results will be placed into `var/<format>/test-<short_spec>.xml`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single backticks make things italic, you probably want double backticks to make it monospace.



----------------
using test-suite
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using should probably start with a capital U.


---
test-suite:
enable: [bzip2, libelf, .. ,libdwarf]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't everything after test-suite be indented further?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes


$ spack test-suite -c /location/of/yamlFile

Currently output files are stored in you current working directory. A folder name spack-test-YYYY-MM-DD this may change in the future.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar.

Junit
^^^^^

With
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a colon to the end.

^^^^^

Spack supports the XML format used by `CDash <http://www.cdash.org/>`_.
To create reports in this format, do
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a colon to the end.


$ spack install --log-file report --log-format=cdash <spec>

This will produce each one file for the configure, build, and test step.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar.


$ curl --upload-file report.build.xml <cdash url>/submit.php?project=<projectname>
$ curl --upload-file report.configure.xml <cdash url>/submit.php?project=<projectname>
$ curl --upload-file report.test.xml <cdash url>/submit.php?project=<projectname>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can add a Spack command to automate this?

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Apr 15, 2017

@kielfriedt: The libstdc++ issue you were having is fixed by #3854 (or by removing [email protected] from your compilers.yaml on your Mac) , and the concretization issues were fixed by merging the latest develop. I'm going to clean this up over the weekend and get it merged into the mainline.

@tgamblin
Copy link
Copy Markdown
Member

@kielfriedt: I reworked this. Can you look at the code and comments in 7b50e15 and let's go over it tomorrow. I think this is pretty close to ready.

TODO:

  • docs need updating as I changed the test-suite format to be more generic.
  • test-suite shouldn't be using requests. Use curl instead to be consistent (and to not require a new dependency)

gcc:
versions: [4.9.0, 4.7.1, 4.6.3, 4.6.1]
clang:
versions: [7.3.0, 3.4, 3.1]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was taking a brief look at this PR, and it looks great. Thanks @kielfriedt !


A random thought: if in the future we'll be able to extend this yaml file to treat virtual dependencies and similar things correctly, we may use it beyond build tests. What I am thinking is reproducing the build of an entire environment on a different machine. Roughly:

spack export ... # Exports a YAML file similar to this one

# Move to another machine...
spack install -f suite.yaml  # Reinstall the "same" software, for some notion of "same"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know a lot of Spack users are currently creating massive dummy-packages to do something similar to this. A suite.yaml file would be much cleaner.

Copy link
Copy Markdown
Member

@tgamblin tgamblin Apr 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the intent with spack.util.spec_set. The way I've reworked it, you can basically cartesian-product arbitrary lists of specs. The compilers and packages elements are shorthand for particular types of spec lists.

The schema is currently written with spack test-suite in mind, but it can be factored out to a suite.yaml or maybe stack.yaml. Which do you like better? I kind of like stack.yaml and thought about calling the format spack-stack instead of test-suite.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No preference.

@alalazo
Copy link
Copy Markdown
Member

alalazo commented May 12, 2017

@kielfriedt I think you need to update the command test-suite for the Travis test to pass.

Benedikt Hegner and others added 8 commits June 28, 2017 20:57
- Created new command called testsuite.
- Takes a yaml file describing tests, produces XML and sends to CDash.
  - two XML formats: simple and complete
    -. simple is only build
    - complete is configure, build, test.
- added an example yaml file
- CDash builds display with platform icons.
- Added documentation to the testing_guide for the test-suite command
  - document include, exclude, packages, compilers elements
- test-suite takes options to display multiple dashboards.
- added tests for test-suite command
- Split out CombinatorialSpecSet into its own spack.util.spec_set module.
  - class is iterable and encaspulated YAML parsing and validation.

- Get rid of copy/pasted code in test-suite command.
  - consolidate line-numbered YAML error code into spack.schema.

- Rework test-suite schema format
  - previous format wasn't actually validating -- only had definitions.

- Adjust YAML format to be more generic
  - YAML test-suite format now has a `matrix` section, which can contain
    multiple lists of specs, generated different ways. Including:
    - specs: a raw list of specs.
    - packages: a list of package names and versions
    - compilers: a list of compiler names and versions

  - All of the elements of `matrix` are dimensions for the build matrix;
    we take the cartesian product of these lists of specs to generate a
    build matrix.  This means we can add things like [^mpich, ^openmpi]
    to get builds with different MPI versions.  It also means we can
    multiply the build matrix out with lots of different parameters.

- clean up logic in test-suite command

- Bug fixes:
  - fix some bugs with compilers_for_arch()
  - fix bug with constraining an anonymous spec by name, add a test.
@pramodskumbhar
Copy link
Copy Markdown
Contributor

@kielfriedt : this is awesome and would like to try! it would be great if pending issues solved and get merged.

@tgamblin
Copy link
Copy Markdown
Member

@pramodk: we're revising this and it'll be in by the end of the month.

@pramodskumbhar
Copy link
Copy Markdown
Contributor

thanks @tgamblin. With the current format below, seems like not possible to specify spec saying hdf5%intel ^zlib%gcc (?).

  test-suite:
    matrix:
     - packages:
       libelf:
         versions: [0.8.12]
       libdwarf:
         versions: [0.8.12]
 
     - compilers:
       clang:
         versions: [7.0.2-apple]
       gcc:
         versions: [6.2.0]

I see that test-suite is more for testing individual packages. But for deployment purpose similar functionality will be useful? I am using space-packagelist from @alalazo which is very useful. (just pointing out in case relevant here as well).

@tgamblin tgamblin added the WIP label Sep 14, 2017
@tgamblin
Copy link
Copy Markdown
Member

@pramodk: I pushed my WIP branch, which still needs rebasing on develop, but it supports another syntax where you can take cartesian products of arbitrary spec lists. It's not currently documented, but I think it'll let you do what you want, e.g.:

matrix:
    - specs: ['hdf5%intel', 'hdf5%gcc']
    - specs: ['^zlib%intel', '^zlib%gcc']

That would concretize each of these (the products), and try to build the result:

hdf5%intel ^zlib%intel
hdf5%intel ^zlib%gcc
hdf5%gcc ^zlib%intel
hdf5%gcc ^zlib%gcc

You could add another specs element if you, say, wanted to try all of them with and without MPI, and you could use include and exclude to poke holes or slice the matrix if you wanted something less dense.

@pramodskumbhar
Copy link
Copy Markdown
Contributor

pramodskumbhar commented Oct 14, 2017

I was testing this today and come across following issues :

  • --log-format=cdash-complete : only cdash instead (docs).
  • if I do spack install -v --log-format=cdash then I expected reports to be in var/spack/cdash-report similar to junit. But they get written in the current directory.
  • when I used default spack cdash server, I saw error/warning like :
<cdash version="2.5.0">
 <status>ERROR</status>
 <message>Not a valid project.</message>
</cdash>
  • when I removed cdash key from yaml file then I see:
Cannot open file (/opt/cdash/CDash/backup/spack_bluebrain355-epfl-ch_mod2c-devopt-gcc-4-4-arch-darwin-sierra-x86_64-rhiljpp_20171410-11:00:36-Experimental_150797163783.62_Build.xml)

I should able to run test-suite without considering cdash server details?

  • I see messages like :
==> Creating mock database for building.
....
==> Restoring user database.

what happens if I cancel test-suite in the middle?

  • It will be of great help if I can see "preview" of test-suite before building it. I mean something like spack spec -I for every combination that Spack is going to build. Currently I don't get an idea about combinations that are going to be built (as a new user).

  • Not sure where I can specify package variant to build:

    matrix:
    - packages:
        coreneuron:
            versions: [develop]

(docs update)

@tgamblin tgamblin modified the milestones: v1.0, v0.12.0 Nov 12, 2017
@tgamblin tgamblin modified the milestones: v0.12.0, v0.13.0 Feb 21, 2018
@tgamblin
Copy link
Copy Markdown
Member

Superseded by #7114.

@tgamblin tgamblin closed this Feb 21, 2018
@tgamblin tgamblin deleted the wip branch January 12, 2019 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands tests General test capability(ies) WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants