Skip to content

Commit

Permalink
reorganize examples for spack.schema.json into separate buildspecs fo…
Browse files Browse the repository at this point in the history
…r valid and invalid buildspecs

remove test_spack.py script and instead add the method to file test_script_compiler_and_spack.py
  • Loading branch information
shahzebsiddiqui committed Jun 26, 2023
1 parent f13bee4 commit 600f4aa
Show file tree
Hide file tree
Showing 24 changed files with 307 additions and 368 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
buildspecs:
additionalProperties_spack_field:
type: spack
executor: generic.local.sh
description: additional Properties can't be specified in spack section
spack:
root: $HOME/spack
FOO: BAR
env:
create:
name: myproject
specs:
- zlib
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
buildspecs:
spack_test_additionalProperties:
type: spack
executor: generic.local.sh
description: "Check for additionalProperties in test section. FOO key is not allowed"
tags: [spack]
pre_cmds: |
cd /tmp
git clone https://github.com/spack/spack
spack:
root: /tmp/spack
verify_spack: false
install:
specs: ['m4', 'zlib']
test:
FOO: BAR
remove_tests: true
run:
specs: ['m4', 'zlib']
81 changes: 0 additions & 81 deletions buildtest/schemas/examples/spack.schema.json/invalid/examples.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
buildspecs:
invalid_type_mirror_field:
type: spack
executor: generic.local.sh
description: The mirror field must be a key value pair
spack:
root: $HOME/spack
mirror: https://caches.e4s.io
env:
create:
name: myproject
specs:
- zlib
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
buildspecs:
spack_test_run_invalid_spec:
type: spack
executor: generic.local.sh
description: "specs property requires a list of strings. "
tags: [spack]
pre_cmds: |
cd /tmp
git clone https://github.com/spack/spack
spack:
root: /tmp/spack
verify_spack: false
install:
specs: ['m4', 'zlib']
test:
remove_tests: true
run:
specs: ['m4', 1]
results:
option: '-f'
post_cmds: |
spack find
rm -rf $SPACK_ROOT
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
buildspecs:
specs_must_be_list_of_strings:
type: spack
executor: generic.local.sh
description: 'specs must be a list of strings'
spack:
root: $HOME/spack
env:
create:
name: myproject
specs: [1, zlib]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
buildspecs:
env_activate:
type: spack
executor: generic.local.sh
description: Activate spack environment by name
spack:
root: $HOME/spack/
env:
activate:
name: myproject
specs:
- m4
- zlib
install:
options: ''
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
buildspecs:
env_concretized_install:
type: spack
description: run 'spack concretize -f' in an environment and install specs
executor: generic.local.sh
spack:
root: $HOME/spack/
env:
create:
name: myproject
manifest: $HOME/spack.yaml
concretize: true
install:
options: '--cache-only'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
buildspecs:
env_create_directory:
type: spack
executor: generic.local.sh
description: Create spack environment by directory
spack:
root: $HOME/spack/
env:
create:
dir: $HOME/spack-env/myproject
specs:
- 'm4'
- 'zlib@1.2.11'
install:
options: '--cache-only'
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
buildspecs:
env_create_from_manifest:
type: spack
executor: generic.local.sh
description: Create spack enviromment from manifest file
spack:
root: $HOME/spack/
env:
create:
name: myproject
manifest: $HOME/spack.yaml
install:
options: '--cache-only'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
buildspecs:
env_create_name:
type: spack
executor: generic.local.sh
description: Create spack environment by name
spack:
root: $HOME/spack/
env:
create:
name: myproject
specs:
- m4
- zlib
install:
options: ''
15 changes: 15 additions & 0 deletions buildtest/schemas/examples/spack.schema.json/valid/env_mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
buildspecs:
env_mirror:
type: spack
executor: generic.local.sh
description: declare spack mirror 'spack mirror add h5 /path/to/mirror' in environment
spack:
root: $HOME/spack/
env:
mirror:
h5: /path/to/mirror
create:
name: myproject
manifest: $HOME/spack.yaml
install:
options: '--cache-only'
Loading

0 comments on commit 600f4aa

Please sign in to comment.