diff options
| -rw-r--r-- | tests/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | tests/data/generic_based_on.ini | 65 | ||||
| -rw-r--r-- | tests/data/generic_based_on.yml | 9 | ||||
| -rw-r--r-- | tests/rt_generic_based_on.sh | 29 | 
4 files changed, 106 insertions, 0 deletions
| diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0da290f..343f838 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,11 +10,14 @@ set(nix_clang_cflags -Wno-format-truncation -Wno-unused-parameter -Wno-unused-re  set(win_msvc_cflags /Wall)  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/generic.ini ${CMAKE_CURRENT_BINARY_DIR} COPYONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/generic_based_on.ini ${CMAKE_CURRENT_BINARY_DIR} COPYONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/generic_based_on.yml ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/result.xml ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/result_error.xml ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)  file(GLOB source_files "test_*.c")  if (BASH_PROGRAM AND BUILD_TESTING_RT) +    add_test (rt_generic_based_on ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/rt_generic_based_on.sh)      add_test (rt_generic ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/rt_generic.sh)  endif() diff --git a/tests/data/generic_based_on.ini b/tests/data/generic_based_on.ini new file mode 100644 index 0000000..9e6ac5d --- /dev/null +++ b/tests/data/generic_based_on.ini @@ -0,0 +1,65 @@ +[meta] +mission = generic +name = GENERIC +version = 1.2.3 +rc = 1 +final = false +based_on = generic_based_on.yml +python = 3.11 + + +[conda] +installer_name = Miniforge3 +installer_version = 24.3.0-0 +installer_platform = {{env:STASIS_CONDA_PLATFORM}} +installer_arch = {{env:STASIS_CONDA_ARCH}} +installer_baseurl = https://github.com/conda-forge/miniforge/releases/download/{{conda.installer_version}} +;conda_packages = +pip_packages = +    firewatch==0.0.4 +    tweakwcs==0.8.8 + + +[runtime] +CPPFLAGS = ${CPPFLAGS} -fpermissive +PYTHONUNBUFFERED = 1 + + +[test:firewatch] +repository = https://github.com/astroconda/firewatch +script_setup = +    pip install -e '.' +script = +    firewatch -c conda-forge -p ${STASIS_CONDA_PLATFORM_SUBDIR} | grep -E ' python-[0-9]' + + +[test:tweakwcs] +repository = https://github.com/spacetelescope/tweakwcs +script_setup = +    pip install -e '.[test]' +script = +    pytest \ +        -r fEsx \ +        --basetemp="{{ func:basetemp_dir() }}" \ +        --junitxml="{{ func:junitxml_file() }}" + + +[deploy:artifactory:delivery] +files = +    {{ storage.output_dir }}/** +dest = {{ meta.mission }}/{{ info.build_name }}/ + + +[deploy:docker] +registry = bytesalad.stsci.edu +image_compression = zstd -v -9 -c +build_args = +    SNAPSHOT_INPUT={{ info.release_name }}.yml +    SNAPSHOT_PKGDIR=packages +tags = +    {{ meta.name }}:{{ info.build_number }}-py{{ meta.python_compact }} +    {{ deploy.docker.registry }}/{{ meta.name }}:{{ info.build_number }}-py{{ meta.python_compact }} +test_script = +    source /etc/profile +    python -m pip freeze +    mamba info diff --git a/tests/data/generic_based_on.yml b/tests/data/generic_based_on.yml new file mode 100644 index 0000000..3ab97a7 --- /dev/null +++ b/tests/data/generic_based_on.yml @@ -0,0 +1,9 @@ +channels: +  - conda-forge +dependencies: +  - pip +  - python +  - setuptools +  - pip: +    - firewatch==0.0.3 +    - tweakwcs==0.8.7
\ No newline at end of file diff --git a/tests/rt_generic_based_on.sh b/tests/rt_generic_based_on.sh new file mode 100644 index 0000000..7ca11ce --- /dev/null +++ b/tests/rt_generic_based_on.sh @@ -0,0 +1,29 @@ +here="$(dirname ${BASH_SOURCE[0]})" +source $here/setup.sh + +TEST_NAME=generic_based_on +PYTHON_VERSIONS=( +    3.11 +) +setup_workspace "$TEST_NAME" +install_stasis + +ln -s "$TOPDIR"/"$TEST_NAME".yml +for py_version in "${PYTHON_VERSIONS[@]}"; do +    run_stasis --python "$py_version" \ +        --no-docker \ +        --no-artifactory \ +        "$TOPDIR"/"$TEST_NAME".ini +done + +check_output_add "(null)" +check_output_stasis_dir stasis/*/output +check_output_reset + +# NOTE: indexer default output directory is "output" +check_output_add "(null)" +run_stasis_indexer stasis +check_output_indexed_dir output +check_output_reset + +teardown_workspace "$TEST_NAME" | 
