Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up unit testing infrastructure for ATDM Trilinos bash-based scripts #5939

Closed
4 of 6 tasks
bartlettroscoe opened this issue Sep 19, 2019 · 8 comments
Closed
4 of 6 tasks
Labels
ATDM DevOps Issues that will be worked by the Coordinated ATDM DevOps teams CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. type: enhancement Issue is an enhancement, not a bug

Comments

@bartlettroscoe
Copy link
Member

bartlettroscoe commented Sep 19, 2019

Description:

The ATDM Trilinos system composed of bash scripts is complex enough that we need to start adding automated testing for the bash functions and scripts.

Tasks:

@bartlettroscoe bartlettroscoe added type: enhancement Issue is an enhancement, not a bug ATDM DevOps Issues that will be worked by the Coordinated ATDM DevOps teams labels Sep 19, 2019
@bartlettroscoe
Copy link
Member Author

This looks pretty close to what we need:

bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Nov 14, 2019
There was bad logic put in to fix the last bug.

This script really needs to be put under automated test (see trilinos#5939)
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Nov 14, 2019
There was bad logic put in to fix the last bug.

This script really needs to be put under automated test (see trilinos#5939)
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Nov 14, 2019
There was bad logic put in to fix the last bug.  This break the EMPIRE
Trilinos testing/integration process (trilinos#6276).

This script really needs to be put under automated test (see trilinos#5939).
brian-kelley pushed a commit that referenced this issue Nov 18, 2019
There was bad logic put in to fix the last bug.  This break the EMPIRE
Trilinos testing/integration process (#6276).

This script really needs to be put under automated test (see #5939).
jeforster pushed a commit to jeforster/Trilinos that referenced this issue Nov 19, 2019
There was bad logic put in to fix the last bug.  This break the EMPIRE
Trilinos testing/integration process (trilinos#6276).

This script really needs to be put under automated test (see trilinos#5939).
bartlettroscoe added a commit that referenced this issue Apr 2, 2020
For now, this just allows for manaul testing of hostname matching.  Longer
term, it will allow for unit testing of this logic (see #5939).
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 10, 2020
For now, this just allows for manaul testing of hostname matching.  Longer
term, it will allow for unit testing of this logic (see trilinos#5939).
@bartlettroscoe
Copy link
Member Author

CC: @e10harvey

It just occurred to me how we might be able to do poor-man's unit testing with bash code without needing an elaborate unit test harness (and therefore another dependency). I think I am going to experiment with that quickly.

@bartlettroscoe
Copy link
Member Author

I am looking at:

some and a few things I see that I don't like:

  • There a quite a few files. It is not all that small (but they are trying to support a bunch of different shells)
  • It supports reporting line numbers but not fine names in the error messages
  • Does not print out the names of vars being checked.
  • Does not print out the functions being called and checked.
  • It does not have any tests of its own (how can I know the unit test harness actually works?)

I am going to download this tool and play with this a little and see what I can learn but I think I want to build my own small little unit test harness in bash that will have:

  • Add asserts that will print the vars being checked and the functions being called.
  • All asserts will support file name and line number reporting.
  • It will report the total number of tests run and the number of total asserts and passing asserts (so I can grep for that in CTest).
  • Some unit testing of itself (raw bash tests).

bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
…-339)

This makes getting unit tests up and running very fast but I am not very
impressed with the error output when a failure occurs.
@bartlettroscoe
Copy link
Member Author

Okay, I have been using shunit2 for a little bit here and it is good enough for what I need and it has some nice features. I am going to just snapshot a version of this under Trilinos/cmake/std/atdm/test/sunit2 and be done with it. It is not that large and it has a very flexible Apache 2 license that should not give any customer a problem.

bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 17, 2020
This now matches more carefully and will not match in the middle of words.
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 18, 2020
@bartlettroscoe bartlettroscoe removed the AT: RETEST Causes the PR autotester to run a new round of PR tests on the next iteration label Apr 20, 2020
trilinos-autotester added a commit that referenced this issue Apr 20, 2020
…_arch-and-unit-tests

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: ATDM: Switch to true keyword matching for utils/set_build_options.sh and add strong unit tests (#4063, #5939, CDOFA-27)
PR Author: bartlettroscoe
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 20, 2020
…inos#5939)

This makes it robust in case you already have an ATDM Trilinos env loaded.
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 20, 2020
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Apr 20, 2020
jmgate pushed a commit to tcad-charon/Trilinos that referenced this issue Apr 21, 2020
…s:develop' (62508f2).

* trilinos-develop:
  Tacho - disable tests for kokkos task scheduler
  TrilinosCouplings: More cleanup to Poisson2D driver
  MueLu: Avoid throwing exceptions in smoother construction
  MueLu RefMaxwell: Copy D0 matrix
  ATDM: Remove some duplicate asserts found in review (trilinos#5939)
  Fix capitalization of Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE in ShyLU dependencies.
  Update TrilinosFrameworkTests for addition of TrilinosATDMConfigTest package (trilinos#5939)
  ATDM: van1-tx2: Switch to atdm_match_any_buildname_keyword (trilinos#5939, CDOFA-27)
  ATDM: van1-tx2: Add unit tests for custom_builds.sh (CDOFA-72)
  Add TrilinosATDMConfigTests package (trilinos#5939)
  ATDM: Change to true keyword matching with unit tests for set_build_options.sh (trilinos#4063, trilinos#5939)
  Add atdm_match_any_keyword (trilinos#5939)
  Add atdm_match_keyword (trilinos#4063, trilinos#5939, ATDV-339)
  Allow 'default' to have stuff after it (trilinos#5939, ATDV-339)
  Automatic snapshot commit from shunit2 at ebc4baa
  Tacho - export crs matrix in external interface example
jmgate pushed a commit to tcad-charon/Trilinos that referenced this issue Apr 21, 2020
…s:develop' (62508f2).

* trilinos-develop:
  Tacho - disable tests for kokkos task scheduler
  TrilinosCouplings: More cleanup to Poisson2D driver
  MueLu: Avoid throwing exceptions in smoother construction
  MueLu RefMaxwell: Copy D0 matrix
  ATDM: Remove some duplicate asserts found in review (trilinos#5939)
  Fix capitalization of Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE in ShyLU dependencies.
  Update TrilinosFrameworkTests for addition of TrilinosATDMConfigTest package (trilinos#5939)
  ATDM: van1-tx2: Switch to atdm_match_any_buildname_keyword (trilinos#5939, CDOFA-27)
  ATDM: van1-tx2: Add unit tests for custom_builds.sh (CDOFA-72)
  Add TrilinosATDMConfigTests package (trilinos#5939)
  ATDM: Change to true keyword matching with unit tests for set_build_options.sh (trilinos#4063, trilinos#5939)
  Add atdm_match_any_keyword (trilinos#5939)
  Add atdm_match_keyword (trilinos#4063, trilinos#5939, ATDV-339)
  Allow 'default' to have stuff after it (trilinos#5939, ATDV-339)
  Automatic snapshot commit from shunit2 at ebc4baa
  Tacho - export crs matrix in external interface example
jmgate pushed a commit to tcad-charon/Trilinos that referenced this issue Apr 22, 2020
…s:develop' (834fcf6).

* trilinos-develop:
  ATDM: van1-tx2: Address problem of 'van1-tx2' matching KOKKOS_ARCH=TX2 (trilinos#4063, CDOFA-27)
  Tempus: Adding AppAction for IMEX RK and Partition
  MueLu: adapt doxygen build to changes in Xpetra
  Xpetra: add build target for doxygen documentation
  ATDM: Switch cee-rhel6/environment.sh to keyword matching and strengthen unit tests (ATDV-322, trilinos#5939)
  ATDM: Add unit tests for cee-rhel6/custom_builds.sh (trilinos#5939, ATDV-322)
  ATDM: Fix atdm/utils/set_build_options.sh on all platforms/envs (trilinos#5939)
  Make timer unit-tests more robust to prevent failures due to noise.
  ATDM: cee-rhel6: Remove support for deprecated clang and gnu compilers/mpi (ATDV-322)
  ATDM: cee-rhel6: fixed clang-5 typo to clang-9 (ATDV-322)
  ATDM: cee-rhel6: switch from clang-5.0.1 to clang-9.0.1 (ATDV-322)
  MueLu: fix typos
  MueLu: adapt doc of non-serializable data
  MueLu: get dual/primal node mapping from user data
  MueLu: use Teuchos::null
  MueLu: remove some trailing white spaces
  MueLu: make some documentation doxygen-compatible
jmgate pushed a commit to tcad-charon/Trilinos that referenced this issue Apr 23, 2020
…s:develop' (834fcf6).

* trilinos-develop: (38 commits)
  ATDM Config:  Don't get-platform on Vortex
  removed second typedef and made explicit
  set Tpetra_INST_INT_INT ON
  MueLu DriverCore: Epetra matrix unwrapping
  Xpetra: Fix CheckRepairMainDiagonal debug check
  MueLu: Silence warning
  MueLu: Fix CircNspDependency test
  MueLu RefMaxwell: Epetra implicit tranpose struggles with explicit zeros
  MueLu RefMaxwell: Only create timers when asked for
  ATDM: van1-tx2: Address problem of 'van1-tx2' matching KOKKOS_ARCH=TX2 (trilinos#4063, CDOFA-27)
  Tempus: Adding AppAction for IMEX RK and Partition
  MueLu: adapt doxygen build to changes in Xpetra
  Xpetra: add build target for doxygen documentation
  ATDM: Switch cee-rhel6/environment.sh to keyword matching and strengthen unit tests (ATDV-322, trilinos#5939)
  ATDM: Add unit tests for cee-rhel6/custom_builds.sh (trilinos#5939, ATDV-322)
  ATDM: Fix atdm/utils/set_build_options.sh on all platforms/envs (trilinos#5939)
  Make timer unit-tests more robust to prevent failures due to noise.
  ATDM: cee-rhel6: Remove support for deprecated clang and gnu compilers/mpi (ATDV-322)
  ATDM: cee-rhel6: fixed clang-5 typo to clang-9 (ATDV-322)
  ATDM: cee-rhel6: switch from clang-5.0.1 to clang-9.0.1 (ATDV-322)
  ...
jmgate pushed a commit to tcad-charon/Trilinos that referenced this issue Apr 23, 2020
…s:develop' (834fcf6).

* trilinos-develop: (38 commits)
  ATDM Config:  Don't get-platform on Vortex
  removed second typedef and made explicit
  set Tpetra_INST_INT_INT ON
  MueLu DriverCore: Epetra matrix unwrapping
  Xpetra: Fix CheckRepairMainDiagonal debug check
  MueLu: Silence warning
  MueLu: Fix CircNspDependency test
  MueLu RefMaxwell: Epetra implicit tranpose struggles with explicit zeros
  MueLu RefMaxwell: Only create timers when asked for
  ATDM: van1-tx2: Address problem of 'van1-tx2' matching KOKKOS_ARCH=TX2 (trilinos#4063, CDOFA-27)
  Tempus: Adding AppAction for IMEX RK and Partition
  MueLu: adapt doxygen build to changes in Xpetra
  Xpetra: add build target for doxygen documentation
  ATDM: Switch cee-rhel6/environment.sh to keyword matching and strengthen unit tests (ATDV-322, trilinos#5939)
  ATDM: Add unit tests for cee-rhel6/custom_builds.sh (trilinos#5939, ATDV-322)
  ATDM: Fix atdm/utils/set_build_options.sh on all platforms/envs (trilinos#5939)
  Make timer unit-tests more robust to prevent failures due to noise.
  ATDM: cee-rhel6: Remove support for deprecated clang and gnu compilers/mpi (ATDV-322)
  ATDM: cee-rhel6: fixed clang-5 typo to clang-9 (ATDV-322)
  ATDM: cee-rhel6: switch from clang-5.0.1 to clang-9.0.1 (ATDV-322)
  ...
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
…ptions.sh (trilinos#4063, trilinos#5939)

This uses the new bash functions atdm_match[_any][_buildname]_keyword to do
solid solid keyword matching that removes any case sensitivity in the build
name or keywords themselves.

As part of this, I also addressed allowing the KOKKOS_ARCH keyword used in the
build name to be any keyword and allow it to appear anywhere in build name.
This allows matching to what SPARC uses for its build names.  (This addresses

I also added strong unit tests for this using the newly snapshotted shunit2
unit testing framework for scripting code. (These unit tests are pretty
solid.)

NOTE: This will technically break backward compatiblity because it would match
keywords in names were it should not have before.  For example, before, the
build name 'gnu-7.2.0-openmpi-4.0.2-opt' wouild match the keyword 'openmp' but
now it will not.  This may break some user's builds but hopefully they will
see the problem and fix their build names.
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
The ATDM Trilinos Configuration scripts have become complex enough and
important enough that they need to be under automated testing.
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
…5939, CDOFA-27)

Now 'arm' will not match non-keywords.

I also added this to the ATDMTrilinosConfigTests package tests.
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
…package (trilinos#5939)

Now when there are changes in the directory cmake/std/atdm/, this will trigger
the enable of the package TrilinosATDMConfigTests instead of enabling nothing.
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
…inos#5939)

This makes it robust in case you already have an ATDM Trilinos env loaded.
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
kliegeois pushed a commit to kliegeois/Trilinos that referenced this issue May 29, 2020
@bartlettroscoe
Copy link
Member Author

With the recent merge of PR #8013 and the soon-to-be-merged PR #8026, I think we have some pretty decent unit testing in place.

The last thing to unit test in the atdm/load-env.sh script. I think that will be easy to do with the addition of the test custom env:

That will ensure that the basic mechanics work as they should.

@github-actions
Copy link

This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity.
If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE label.
If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE.
If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.

@github-actions github-actions bot added the MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. label Sep 25, 2021
@github-actions
Copy link

github-actions bot commented Nov 6, 2021

This issue was closed due to inactivity for 395 days.

@github-actions github-actions bot added the CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. label Nov 6, 2021
@github-actions github-actions bot closed this as completed Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ATDM DevOps Issues that will be worked by the Coordinated ATDM DevOps teams CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. type: enhancement Issue is an enhancement, not a bug
Projects
None yet
Development

No branches or pull requests

1 participant