Merge ~gabrielcocenza/juju-lint:bug/1990885-b into juju-lint:master

Proposed by Gabriel Cocenza
Status: Merged
Approved by: Erhan Sunar
Approved revision: 36f4a6680caffd5ef7893cf5fe6c02173949841c
Merged at revision: b30ed0bca5242d19d42d383391e0d7f7cfd4870a
Proposed branch: ~gabrielcocenza/juju-lint:bug/1990885-b
Merge into: juju-lint:master
Diff against target: 86 lines (+13/-4)
6 files modified
.gitignore (+1/-0)
CONTRIBUTING.md (+2/-2)
jujulint/checks/__init__.py (+1/-0)
setup.py (+1/-1)
tests/functional/conftest.py (+5/-0)
tox.ini (+3/-1)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-bootstack continuous-integration Approve
Erhan Sunar (community) Approve
Tianqi Xiao (community) Approve
Eric Chen Approve
BootStack Reviewers Pending
Review via email: mp+433889@code.launchpad.net

Commit message

add subdirectories and fixed functional tests

- fixed setup.py to accept subdirectories under the jujulint project
  folder.
- changed the working directory when running functional tests with
  the snap to not use local modules.
- updated contributing for func-smoke and func-dev to run functional
  tests during development.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Eric Chen (eric-chen) :
review: Approve
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gabriel Cocenza (gabrielcocenza) wrote :

pastebin[0] of the unit, lint and functional tests

[0] https://pastebin.canonical.com/p/kS4CrD7pSq/

Revision history for this message
Tianqi Xiao (txiao) wrote :

LGTM

review: Approve
Revision history for this message
Erhan Sunar (esunar) :
review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision b30ed0bca5242d19d42d383391e0d7f7cfd4870a

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index b095e7e..54afb54 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -5,6 +5,7 @@
6 juju_lint.egg-info/
7 dist/
8 tests/report/
9+build/
10
11 # python artefacts
12 __pycache__
13diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
14index 2baa385..8e06d63 100644
15--- a/CONTRIBUTING.md
16+++ b/CONTRIBUTING.md
17@@ -60,9 +60,9 @@ However for development purposes, the testing infrastructure also allows for ins
18 and running tests against it.
19 In order to invoke:
20 - development smoke suite, which deselects tests running against a live lxd cloud
21- - `$ tox -e func-smoke`
22+ - `$ tox -e func -- -m smoke -v`
23 - development full suite, which runs all the functional tests
24- - `$ tox -e func-dev`
25+ - `$ tox -e func`
26
27
28 ## Canonical Contributor Agreement
29diff --git a/jujulint/checks/__init__.py b/jujulint/checks/__init__.py
30new file mode 100644
31index 0000000..3bb8cbc
32--- /dev/null
33+++ b/jujulint/checks/__init__.py
34@@ -0,0 +1 @@
35+"""Import this library to fetch and lint the configuration and status of Juju environments."""
36diff --git a/setup.py b/setup.py
37index 9bd497c..6a8f82c 100644
38--- a/setup.py
39+++ b/setup.py
40@@ -42,7 +42,7 @@ setuptools.setup(
41 "Intended Audience :: System Administrators",
42 ],
43 python_requires=">=3.7",
44- packages=["jujulint"],
45+ packages=setuptools.find_packages(include=("jujulint*")),
46 entry_points={"console_scripts": ["juju-lint=jujulint.cli:main"]},
47 setup_requires=["setuptools_scm"],
48 )
49diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py
50index fdbd012..6620b31 100644
51--- a/tests/functional/conftest.py
52+++ b/tests/functional/conftest.py
53@@ -25,6 +25,9 @@ def install_package():
54 """
55 jujulint_test_snap = os.environ.get("TEST_SNAP", None)
56 if jujulint_test_snap:
57+ # change directory to not import from local modules and force using the snap package
58+ cwd = os.getcwd()
59+ os.chdir("/tmp")
60 logging.info(f"Installing {jujulint_test_snap}")
61 assert os.path.isfile(jujulint_test_snap)
62 assert (
63@@ -49,6 +52,8 @@ def install_package():
64 yield jujulint_test_snap
65
66 if jujulint_test_snap:
67+ # return to the previous working directory
68+ os.chdir(cwd)
69 logging.info("Removing snap package juju-lint")
70 check_call("sudo snap remove juju-lint".split())
71 else:
72diff --git a/tox.ini b/tox.ini
73index db766fe..8aefb78 100644
74--- a/tox.ini
75+++ b/tox.ini
76@@ -57,7 +57,9 @@ deps =
77 setenv = PYTHONPATH={toxinidir}
78
79 [testenv:func]
80-deps = -r{toxinidir}/tests/functional/requirements.txt
81+deps =
82+ -r{toxinidir}/tests/functional/requirements.txt
83+ -r{toxinidir}/requirements.txt
84 passenv =
85 TEST_*
86 commands =

Subscribers

People subscribed via source and target branches