Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/v1.0' into v1ssapi
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaputko committed Oct 31, 2024
2 parents 4701e8c + f4e76a4 commit ab6dba5
Show file tree
Hide file tree
Showing 439 changed files with 38,724 additions and 13,997 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
subset: [backends, slow_tests, group_a, group_b]
subset: [backends, slow_tests, group_a, group_b, dragon]
os: [macos-12, macos-14, ubuntu-22.04] # Operating systems
compiler: [8] # GNU compiler version
rai: [1.2.7] # Redis AI versions
Expand All @@ -69,6 +69,14 @@ jobs:
with:
python-version: ${{ matrix.py_v }}

- name: Check Test Files are Marked
run: |
diff <(find tests -path tests/_legacy -prune -o -type f -name 'test_*.py' -print \
| xargs grep -l 'pytestmark' \
| sort) \
<(find tests -path tests/_legacy -prune -o -type f -name 'test_*.py' -print \
| sort)
- name: Install build-essentials for Ubuntu
if: contains( matrix.os, 'ubuntu' )
run: |
Expand Down Expand Up @@ -109,14 +117,31 @@ jobs:
python -m pip install .[dev,mypy]
- name: Install ML Runtimes
if: matrix.subset != 'dragon'
run: smart build --device cpu -v


- name: Install ML Runtimes (with dragon)
if: matrix.subset == 'dragon'
env:
SMARTSIM_DRAGON_TOKEN: ${{ secrets.DRAGON_TOKEN }}
run: |
if [ -n "${SMARTSIM_DRAGON_TOKEN}" ]; then
smart build --device cpu -v --dragon-repo dragonhpc/dragon-nightly --dragon-version 0.10
else
smart build --device cpu -v --dragon
fi
SP=$(python -c 'import site; print(site.getsitepackages()[0])')/smartsim/_core/config/dragon/.env
LLP=$(cat $SP | grep LD_LIBRARY_PATH | awk '{split($0, array, "="); print array[2]}')
echo "LD_LIBRARY_PATH=$LLP:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Run mypy
run: |
make check-mypy
- name: Run Pylint
run: make check-lint
# TODO: Re-enable static analysis once API is firmed up
# - name: Run Pylint
# run: make check-lint

# Run isort/black style check
- name: Run isort
Expand All @@ -134,9 +159,16 @@ jobs:
echo "SMARTSIM_LOG_LEVEL=debug" >> $GITHUB_ENV
py.test -s --import-mode=importlib -o log_cli=true --cov=$(smart site) --cov-report=xml --cov-config=./tests/test_configs/cov/local_cov.cfg --ignore=tests/full_wlm/ ./tests/backends
# Run pytest (dragon subtests)
- name: Run Dragon Pytest
if: (matrix.subset == 'dragon' && matrix.os == 'ubuntu-22.04')
run: |
echo "SMARTSIM_LOG_LEVEL=debug" >> $GITHUB_ENV
dragon -s py.test -s --import-mode=importlib -o log_cli=true --cov=$(smart site) --cov-report=xml --cov-config=./tests/test_configs/cov/local_cov.cfg --ignore=tests/full_wlm/ -m ${{ matrix.subset }} ./tests
# Run pytest (test subsets)
- name: Run Pytest
if: "!contains(matrix.subset, 'backends')" # if not running backend tests
if: (matrix.subset != 'backends' && matrix.subset != 'dragon') # if not running backend tests or dragon tests
run: |
echo "SMARTSIM_LOG_LEVEL=debug" >> $GITHUB_ENV
py.test -s --import-mode=importlib -o log_cli=true --cov=$(smart site) --cov-report=xml --cov-config=./tests/test_configs/cov/local_cov.cfg --ignore=tests/full_wlm/ -m ${{ matrix.subset }} ./tests
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ max-module-lines=1000

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
single-line-class-stmt=yes

# Allow the body of an if to be on the same line as the test if there is no
# else.
Expand Down
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,22 +164,22 @@ tutorials-prod:
# help: test - Run all tests
.PHONY: test
test:
@python -m pytest --ignore=tests/full_wlm/
@python -m pytest --ignore=tests/full_wlm/ --ignore=tests/dragon_wlm

# help: test-verbose - Run all tests verbosely
.PHONY: test-verbose
test-verbose:
@python -m pytest -vv --ignore=tests/full_wlm/
@python -m pytest -vv --ignore=tests/full_wlm/ --ignore=tests/dragon_wlm

# help: test-debug - Run all tests with debug output
.PHONY: test-debug
test-debug:
@SMARTSIM_LOG_LEVEL=developer python -m pytest -s -o log_cli=true -vv --ignore=tests/full_wlm/
@SMARTSIM_LOG_LEVEL=developer python -m pytest -s -o log_cli=true -vv --ignore=tests/full_wlm/ --ignore=tests/dragon_wlm

# help: test-cov - Run all tests with coverage
.PHONY: test-cov
test-cov:
@python -m pytest -vv --cov=./smartsim --cov-config=${COV_FILE} --ignore=tests/full_wlm/
@python -m pytest -vv --cov=./smartsim --cov-config=${COV_FILE} --ignore=tests/full_wlm/ --ignore=tests/dragon_wlm


# help: test-full - Run all WLM tests with Python coverage (full test suite)
Expand All @@ -192,3 +192,8 @@ test-full:
.PHONY: test-wlm
test-wlm:
@python -m pytest -vv tests/full_wlm/ tests/on_wlm

# help: test-dragon - Run dragon-specific tests
.PHONY: test-dragon
test-dragon:
@dragon pytest tests/dragon_wlm
Loading

0 comments on commit ab6dba5

Please sign in to comment.