diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml new file mode 100644 index 0000000..30371b0 --- /dev/null +++ b/.github/workflows/run_tests.yaml @@ -0,0 +1,156 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Run Tests + +on: + - push + - pull_request + +jobs: + ubuntu-latest: + + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10'] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install pyATS + run: | + python -m pip install pip setuptools wheel --upgrade + pip install pyats[full] yang.connector rest.connector --pre + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: pyats version check + run: pyats version check + # - name: ComparePlugin + # run: | + # cat < easypy_config.yaml + # plugins: + # ComparePlugin: + # order: 120 + # enabled: True + # module: genie.utils.compare + # EOF + # export PYATS_CONFIGURATION_EASYPY=easypy_config.yaml + - name: run examples + run: | + cd basic + pyats run job basic_example_job.py --no-mail || echo $? + unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results + grep -A100000 'Task.*' rerun.results > rerun_results + diff -I 'testscript:' -B -C5 rerun_results results/basic_example_result_ext.yaml + sleep 60 + cd .. + - name: comprehensive + run: | + cd comprehensive/job + pyats run job example_job.py --no-mail || echo $? + unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results + grep -A100000 'Task.*' rerun.results > rerun_results + diff -I 'testscript:' -B -C5 rerun_results results/comprehensive_results_ext.yaml + cd .. + + macos-11: + + runs-on: macos-11 + + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10'] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install pyATS + run: | + python -m pip install pip setuptools wheel --upgrade + pip install pyats[full] yang.connector rest.connector --pre + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: pyats version check + run: pyats version check + # - name: ComparePlugin + # run: | + # cat < easypy_config.yaml + # plugins: + # ComparePlugin: + # order: 120 + # enabled: True + # module: genie.utils.compare + # EOF + # export PYATS_CONFIGURATION_EASYPY=easypy_config.yaml + - name: run examples + run: | + cd basic + pyats run job basic_example_job.py --no-mail || echo $? + unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results + grep -A100000 'Task.*' rerun.results > rerun_results + diff -I 'testscript:' -B -C5 rerun_results results/basic_example_result_ext.yaml + sleep 60 + cd .. + - name: comprehensive + run: | + cd comprehensive/job + pyats run job example_job.py --no-mail || echo $? + unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results + grep -A100000 'Task.*' rerun.results > rerun_results + diff -I 'testscript:' -B -C5 rerun_results results/comprehensive_results_ext.yaml + cd .. + + macos-10: + + runs-on: macos-10.15 + + strategy: + matrix: + python-version: [3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install pyATS + run: | + python -m pip install pip setuptools wheel --upgrade + pip install pyats[full] yang.connector rest.connector --pre + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: pyats version check + run: pyats version check + # - name: ComparePlugin + # run: | + # cat < easypy_config.yaml + # plugins: + # ComparePlugin: + # order: 120 + # enabled: True + # module: genie.utils.compare + # EOF + # export PYATS_CONFIGURATION_EASYPY=easypy_config.yaml + - name: run examples + run: | + cd basic + pyats run job basic_example_job.py --no-mail || echo $? + unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results + grep -A100000 'Task.*' rerun.results > rerun_results + diff -I 'testscript:' -B -C5 rerun_results results/basic_example_result_ext.yaml + sleep 60 + cd .. + - name: comprehensive + run: | + cd comprehensive/job + pyats run job example_job.py --no-mail || echo $? + unzip -c $(find ~/.pyats/archive -type f -mmin -1) rerun.results > rerun.results + grep -A100000 'Task.*' rerun.results > rerun_results + diff -I 'testscript:' -B -C5 rerun_results results/comprehensive_results_ext.yaml + cd .. diff --git a/README.md b/README.md index 522f032..bde66ac 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # pyATS | Library Examples This repository contains pyATS and its library's usage examples. The purpose