Skip to content

Commit

Permalink
Minor test fixes and convert over to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers authored Jul 31, 2020
1 parent dca515d commit 9c9ffb7
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 164 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: build
on: [push, pull_request]
jobs:
std_tests:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-genie.txt
- name: Run black
run: |
black --check .
- name: Run linter
run: |
pylama .
- name: Run Tests
run: |
py.test -v -s tests/test_import_netmiko.py
py.test -v -s tests/unit/test_base_connection.py
py.test -v -s tests/unit/test_utilities.py
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PyYAML==5.1.2
black==18.9b0
PyYAML==5.3.1
pytest==5.1.2
pylama==7.7.1
tox==3.14.5
twine==1.13.0
pysnmp==4.4.12
pdoc3==0.6.3
Expand Down
3 changes: 3 additions & 0 deletions tests/test_netmiko_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def test_config_from_file(net_connect, commands, expected_responses):
else:
print("Skipping test (no file specified)...")

if "nokia_sros" in net_connect.device_type:
net_connect.save_config()


def test_disconnect(net_connect, commands, expected_responses):
"""
Expand Down
6 changes: 3 additions & 3 deletions tests/test_netmiko_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ def test_send_command_global_cmd_verify(

def test_send_command_juniper(net_connect, commands, expected_responses):
"""Verify Juniper complete on space is disabled."""
# If complete on space is enabled will get re-written to "show ipv6 neighbors"
# If complete on space is enabled will get re-written to "show configuration groups"
if net_connect.device_type == "juniper_junos":
net_connect.write_channel("show ip neighbors\n")
net_connect.write_channel("show configuration gr \n")
output = net_connect.read_until_prompt()
assert "show ip neighbors" in output
assert "show configuration groups" not in output
else:
assert pytest.skip()

Expand Down
8 changes: 8 additions & 0 deletions tests/test_suite_alt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ echo "Starting tests...good luck:" \
&& echo "Exception and Timeout Tests" \
&& py.test -x -s -v test_netmiko_exceptions.py \
\
&& echo "Juniper vMX" \
&& py.test -x -s -v test_netmiko_show.py --test_device juniper_vmx \
&& py.test -x -s -v test_netmiko_config.py --test_device juniper_vmx \
\
&& echo "Nokia SR-OS" \
&& py.test -x -s -v test_netmiko_show.py --test_device sros1 \
&& py.test -x -s -v test_netmiko_config.py --test_device sros1 \
\
&& echo "Cisco IOS-XE SSH (including SCP)" \
&& py.test -v test_netmiko_scp.py --test_device cisco3 \
&& py.test -v test_netmiko_show.py --test_device cisco3 \
Expand Down
39 changes: 0 additions & 39 deletions tox.ini

This file was deleted.

26 changes: 0 additions & 26 deletions travis_ci_process.txt

This file was deleted.

56 changes: 0 additions & 56 deletions travis_test.py

This file was deleted.

11 changes: 0 additions & 11 deletions travis_test.sh

This file was deleted.

Binary file removed travis_test_env.tar.enc
Binary file not shown.

0 comments on commit 9c9ffb7

Please sign in to comment.