From da81c8a7d5ef48a2fc48f7c806f75e0416b4fb18 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sun, 16 Oct 2022 15:04:23 -0700 Subject: [PATCH 1/8] Add octodns-bind to test-modules action --- .github/workflows/modules.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index e0c052e..8be6247 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -12,6 +12,7 @@ jobs: matrix: module: - octodns/octodns-azure + - octodns/octodns-bind - octodns/octodns-cloudflare - octodns/octodns-constellix - octodns/octodns-ddns From c293bb19b324b628c5564338b71c8aae406e5c40 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sun, 16 Oct 2022 15:56:34 -0700 Subject: [PATCH 2/8] Add ./script/test-module support for poetry and sukiyaki/octodns-netbox to the actions module list --- .github/workflows/modules.yml | 1 + script/test-module | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index 8be6247..97d2fab 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -36,6 +36,7 @@ jobs: - octodns/octodns-selectel - octodns/octodns-transip - octodns/octodns-ultra + - sukiyaki/octodns-netbox steps: - uses: actions/checkout@master - name: Setup python diff --git a/script/test-module b/script/test-module index dff26e8..261e59f 100755 --- a/script/test-module +++ b/script/test-module @@ -25,8 +25,24 @@ cd $TMP_DIR git clone "https://github.com/${module}.git" cd $(basename $module) echo "## install module dev requirements #############################################" -pip install -e .[dev] -export PYTHONPATH=.:$PYTHONPATH +if [ -e setup.py ]; then + pip install -e .[dev] +elif [ -f poetry.toml ]; then + # install poetry + pip install poetry + # make sure that poetry doesn't blow away our locally installed octodns + sed -i '' '/^octodns =/d' pyproject.toml + # now install all the deps + poetry install --no-root -v +else + echo "Unrecognized module management. Supports setup.py and poetry" + exit 1 +fi echo "## run module tests ############################################################" -pytest --disable-network +export PYTHONPATH=.:$PYTHONPATH +if [ -e setup.py ]; then + pytest --disable-network +elif [ -f poetry.toml ]; then + poetry run pytest [] +fi echo "## complete ####################################################################" From 4d025faa21d62ab6d25a509796ec6e0822f74975 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sun, 16 Oct 2022 16:00:43 -0700 Subject: [PATCH 3/8] pyproject.toml is a better indicator of poetry --- script/test-module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/test-module b/script/test-module index 261e59f..1a22408 100755 --- a/script/test-module +++ b/script/test-module @@ -27,7 +27,7 @@ cd $(basename $module) echo "## install module dev requirements #############################################" if [ -e setup.py ]; then pip install -e .[dev] -elif [ -f poetry.toml ]; then +elif [ -f pyproject.toml ]; then # install poetry pip install poetry # make sure that poetry doesn't blow away our locally installed octodns From 7d7cf49522036efc052cbfbb4850089b23bbe427 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sun, 16 Oct 2022 17:16:22 -0700 Subject: [PATCH 4/8] Install test requirements, not dev in test-module --- script/test-module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/test-module b/script/test-module index 1a22408..16d9fc6 100755 --- a/script/test-module +++ b/script/test-module @@ -24,9 +24,9 @@ echo "## checkout provider module ############################################## cd $TMP_DIR git clone "https://github.com/${module}.git" cd $(basename $module) -echo "## install module dev requirements #############################################" +echo "## install module test requirements #############################################" if [ -e setup.py ]; then - pip install -e .[dev] + pip install -e .[test] elif [ -f pyproject.toml ]; then # install poetry pip install poetry From 3125d1f7aa2d6877a928521181fb8d30b8f9255f Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sun, 16 Oct 2022 17:16:56 -0700 Subject: [PATCH 5/8] Explicitly install pytest-network in test-module in case underlying module doesn't include it --- script/test-module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/test-module b/script/test-module index 16d9fc6..3c6237d 100755 --- a/script/test-module +++ b/script/test-module @@ -26,7 +26,7 @@ git clone "https://github.com/${module}.git" cd $(basename $module) echo "## install module test requirements #############################################" if [ -e setup.py ]; then - pip install -e .[test] + pip install -e .[test] pytest-network elif [ -f pyproject.toml ]; then # install poetry pip install poetry From 927ca1e8bcb618c3ed5bcf0b63f67e5554bf527a Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sun, 16 Oct 2022 17:46:23 -0700 Subject: [PATCH 6/8] Revert back to .[dev], .[test] is not (yet) universally a thing --- script/test-module | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/test-module b/script/test-module index 3c6237d..df61a7d 100755 --- a/script/test-module +++ b/script/test-module @@ -24,9 +24,9 @@ echo "## checkout provider module ############################################## cd $TMP_DIR git clone "https://github.com/${module}.git" cd $(basename $module) -echo "## install module test requirements #############################################" +echo "## install module dev requirements #############################################" if [ -e setup.py ]; then - pip install -e .[test] pytest-network + pip install -e .[dev] pytest-network elif [ -f pyproject.toml ]; then # install poetry pip install poetry @@ -38,6 +38,8 @@ else echo "Unrecognized module management. Supports setup.py and poetry" exit 1 fi +echo "## installed modules ###########################################################" +pip freeze echo "## run module tests ############################################################" export PYTHONPATH=.:$PYTHONPATH if [ -e setup.py ]; then From 64759e0236a0a993a269b4207f8d11031b0c1107 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sun, 16 Oct 2022 18:34:47 -0700 Subject: [PATCH 7/8] Add https://github.com/asyncon/octoblox to the test-modules list --- .github/workflows/modules.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index 97d2fab..223feee 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -11,6 +11,7 @@ jobs: fail-fast: false matrix: module: + - asyncon/octoblox - octodns/octodns-azure - octodns/octodns-bind - octodns/octodns-cloudflare From 9ded28204cb4f9b5b7d76cdfce3d95569f526c6c Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sun, 16 Oct 2022 18:40:06 -0700 Subject: [PATCH 8/8] Try to get sed -i that'll work on both OSX and linux --- script/test-module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/test-module b/script/test-module index df61a7d..8148d73 100755 --- a/script/test-module +++ b/script/test-module @@ -31,7 +31,7 @@ elif [ -f pyproject.toml ]; then # install poetry pip install poetry # make sure that poetry doesn't blow away our locally installed octodns - sed -i '' '/^octodns =/d' pyproject.toml + sed -i'.bak' '/^octodns =/d' pyproject.toml # now install all the deps poetry install --no-root -v else