Skip to content

g.extension: fix getting addon directories names without Py/C source code#4900

Open
tmszi wants to merge 7 commits into
OSGeo:mainfrom
tmszi:fix-g_extension-find-addon-which-install-only-html-man-page
Open

g.extension: fix getting addon directories names without Py/C source code#4900
tmszi wants to merge 7 commits into
OSGeo:mainfrom
tmszi:fix-g_extension-find-addon-which-install-only-html-man-page

Conversation

@tmszi

@tmszi tmszi commented Dec 31, 2024

Copy link
Copy Markdown
Member

Fixes #4761.

@tmszi tmszi added bug Something isn't working Python Related code is in Python labels Dec 31, 2024
@tmszi tmszi added this to the 8.4.1 milestone Dec 31, 2024
@tmszi tmszi self-assigned this Dec 31, 2024
ninsbl
ninsbl previously approved these changes Dec 31, 2024

@ninsbl ninsbl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. You may consider adding a test for this case!?!

@echoix echoix changed the title g.extension: fix getting addon dicrectories names without Py/C src code g.extension: fix getting addon directories names without Py/C source code Dec 31, 2024

@echoix echoix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested some changes for some small typos that were obvious to me. I didn't really analyze if the messages make sense in the context, I limited myself to the words

Comment thread scripts/g.extension/g.extension.py
Comment thread scripts/g.extension/g.extension.py
Comment thread scripts/g.extension/g.extension.py Outdated
@tmszi

tmszi commented Jan 3, 2025

Copy link
Copy Markdown
Member Author

Looks good. You may consider adding a test for this case!?!
Test is included

Looks good. You may consider adding a test for this case!?!

Test is included (I extended it with commit bc19b1f):

def test_github_install_official_multimodule_and_check_metadata(self):
"""Test installing multi-module extension from official addons
repository without printing warning no metadata available message
for module wich install HTML page file only"""
extension = "i.sentinel"
gextension = SimpleModule(
"g.extension",
extension=extension,
prefix=str(self.install_prefix),
)
self.assertModule(gextension)
self.assertTrue(gextension.outputs.stderr)
self.assertNotIn(
_("No metadata available for module '{}':").format(extension),
gextension.outputs.stderr,
)

Comment thread scripts/g.extension/g.extension.py Outdated
Comment thread scripts/g.extension/testsuite/test_addons_download.py Outdated
@github-actions github-actions Bot added the tests Related to Test Suite label Jan 3, 2025
@echoix

echoix commented Jan 3, 2025

Copy link
Copy Markdown
Member

At one point we'll need to think about what to do when html man pages might not be the only thing. When using markdown as source, will the addon install a "compiled" page that will HTML (processed from the markdown), or only the source file?

echoix
echoix previously approved these changes Jan 3, 2025
@petrasovaa

Copy link
Copy Markdown
Contributor

Looks like the test failed:

======================================================================
FAIL: test_github_download_official_module_src_code_only (__main__.TestModuleDownloadFromDifferentSources)
Test download extension source code only from official addons
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scripts/g.extension/testsuite/test_addons_download.py", line 193, in test_github_download_official_module_src_code_only
    self.assertTrue(ext_path.exists())
AssertionError: False is not true

----------------------------------------------------------------------
Ran 9 tests in 36.965s
FAILED (failures=1)
========================================================================
FAILED ./scripts/g.extension/testsuite/test_addons_download.py (1 test failed)

@neteler

neteler commented Jan 30, 2025

Copy link
Copy Markdown
Member

I don't know what's wrong in the CI. Locally it doesn't show problems:

cd scripts/g.extension/testsuite/ 
grass --tmp-project XY --exec python test_addons_download.py
[...]
Ran 9 tests in 64.323s
OK

@tmszi

tmszi commented Feb 4, 2025

Copy link
Copy Markdown
Member Author

I don't know what's wrong in the CI. Locally it doesn't show problems:

cd scripts/g.extension/testsuite/ 
grass --tmp-project XY --exec python test_addons_download.py
[...]
Ran 9 tests in 64.323s
OK

On the local emulator terminal (during tests especially g.extension module) is printed to the stderr GRASS GIS command g.extension module output and debug info too. I enable debug mode beacuse I'm checking some debug variable value f"Addon name <{extension}> which install only HTML man page.", (line 240) bc19b1f.

Under CI is printed only debug info (not g.extension module output) and therefore this 'test_github_download_official_module_src_code_only' test fails.

@neteler

neteler commented Feb 6, 2025

Copy link
Copy Markdown
Member

On the local emulator terminal (during tests especially g.extension module) is printed to the stderr GRASS GIS command g.extension module output and debug info too. I enable debug mode beacuse I'm checking some debug variable value f"Addon name <{extension}> which install only HTML man page.", (line 240) bc19b1f.

Under CI is printed only debug info (not g.extension module output) and therefore this 'test_github_download_official_module_src_code_only' test fails.

Do we need to modify the CI test?

@wenzeslaus wenzeslaus modified the milestones: 8.4.1, 8.4.2 Feb 14, 2025
@echoix echoix dismissed their stale review February 27, 2025 11:06

Waiting for tests to be fixed

@neteler neteler modified the milestones: 8.4.2, 8.5.0 Nov 12, 2025
Comment thread scripts/g.extension/testsuite/test_addons_download.py Outdated
Comment thread scripts/g.extension/g.extension.py Outdated
@wenzeslaus wenzeslaus modified the milestones: 8.5.0, 8.5.1 May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working general module Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] i.wi: does not install

6 participants