-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v.build: added tests for v.build module #5061
Draft
Shreshth-Malik
wants to merge
83
commits into
OSGeo:main
Choose a base branch
from
Shreshth-Malik:v.build-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+48,253
−55,091
Draft
Changes from 5 commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
a7c76ee
Added tests for v.build module
Shreshth-Malik d50cd86
doc: Fix parson lib test first keyword (#5060)
wenzeslaus c14f9f4
r.describe: initialize some variables (#5039)
nilason 63107d2
v.distance: initialize variable; remove unused variables (#5043)
nilason acb276f
g.proj: fix resource leaks (#5042)
nilason 69a9b89
v.to.3d: initialize some variables (#5040)
nilason 4ff9373
docs: Update contributing docs to refer to `ruff format` (#5027)
echoix bd2ebf3
docs: Add more HTML to Markdown Lua filters (#5054)
cwhite911 a82a39f
doc: Convert HTML to Markdown (#5064)
wenzeslaus 25e198f
CI(deps): Update github/codeql-action action to v3.28.9 (#5069)
renovate[bot] 7f86b76
CI(deps): Update ruff to v0.9.5 (#5070)
renovate[bot] 2f87135
CI(deps): Update ubuntu:22.04 Docker digest to ed1544e (#5068)
renovate[bot] 708fe06
CI(deps): Update docker/setup-buildx-action action to v3.9.0 (#5071)
renovate[bot] 66050f0
CI(deps): Update docker/setup-qemu-action action to v3.4.0 (#5072)
renovate[bot] 35926d3
Added fixes and suggestions
Shreshth-Malik 6a89b65
style: Ruff rules maintenance (#5073)
echoix 2b7a3f3
CI: Run ruff format with file fixes for PR suggestions (#5074)
echoix d861511
v.info: Add JSON output for history (#4989)
NishantBansal2003 dc6e4c1
lib/raster: Fix Resource Leak issue in quant_io.c (#5076)
ShubhamDesai 7361d0b
Patch for failing test due to temp map name
Shreshth-Malik 9f9be39
i.biomass: added test file for i.biomass module (#4962)
jayneel-shah18 5fe1b99
style: Fix missing-f-string-syntax (RUF027) (#5031)
echoix 1c93c80
lib/vector/Vlib: Fix Resource leak issue in remove_areas.c (#5078)
ShubhamDesai 4e3e14c
lib/vector/Vlib: Fix Resource Leak issue in open_nat.c (#5080)
ShubhamDesai be43b74
raster/r.statistics: Fix Resource Leak issues (#5077)
ShubhamDesai a27e3c1
r.sim: cleanup of global variables (#5044)
petrasovaa bd67b98
doc: Enable Markdown doc compilation (#5048)
wenzeslaus 67cb26b
Translations update from OSGeo Weblate (#4063)
osgeoweblate 6e44916
config: Updated .gitignore paths to ignore python environments and vs…
cwhite911 6c2a040
docs: Added command to serve mkdocs locally (#5089)
cwhite911 b624fc2
docs: fix code snippet languages (#5095)
petrasovaa 72e8c26
ci: Remove Travis-CI (#5099)
wenzeslaus e569a1a
docs: fix building markdown documentation (#5100)
petrasovaa 99cdc5b
build: Fix g.extension test (#5102)
petrasovaa 9c11460
docs: fix markdown image syntax in imagery, display, misc, ps tools a…
petrasovaa c1849f5
doc: Redefine r.mapcalc build dependencies for color table thumbnails…
wenzeslaus 1c1d01d
docker: build gdal-grass with CMake (#5106)
nilason 6b652b6
docker: pin gdal-grass version to 1.0.3; add cmake dep (#5108)
nilason adda9a9
r.sim: Fix incorrect expressions reported by Coverity Scan (#5097)
petrasovaa 7802ac2
docs: fix markdown documentation of GUI tools (#5086)
petrasovaa ffc0b8c
docs: fix markdown image syntax in raster tools (#5092)
petrasovaa c0fe7d7
docs: fix markdown image syntax in vector tools (#5093)
petrasovaa 3ddc3d7
GUI: Use for Markdown documentation if available (#5066)
petrasovaa 442bd61
g.manual: Use new Markdown docs if available (#5110)
petrasovaa 3913be0
lib/vector/Vlib: fix segfault introduced with #5038 (#5109)
metzm 7ad9e95
r.fillnulls: Modified tests for r.fillnulls module (#5026)
Shreshth-Malik d3993e2
docker: Fix git clone path in Dockerfile for gdal-grass (#5111)
echoix a2413bf
Fixed output parsing
Shreshth-Malik 5546b2d
Fixed build fails due to temp meta data
Shreshth-Malik 4173c3d
style: Fix SIM115: Simplify if statement in t.list and PTH201 in v.fi…
arohanajit 2bc4035
docs: Reorganize mkdocs file and nav (#5096)
cwhite911 3ab4f38
r.category: Add output color_format option (#5011)
NishantBansal2003 d657e54
docker: build gdal-grass with grass in working condition (#5115)
nilason 1062c2f
docker: Enable cache for Docker builds (#3821)
echoix 61e38c2
docker: move gdal-grass driver build stage after grass build relocati…
nilason 158e578
CI(deps): Update ruff to v0.9.6 (#5122)
renovate[bot] ea58114
docs: Fix Markdown linting issues heading-increment and no-duplicate-…
petrasovaa 50d61e9
CI: Fix Docker caching with GitHub Actions (#5126)
echoix bab037a
CI(deps): Update alpine:3.21 Docker digest to a8560b3 (#5121)
renovate[bot] d8d8d84
CI(deps): Update flake8 to v7.1.2 (#5131)
renovate[bot] 2f7de93
lib/vector/Vlib: free alloc'd field_info and dbColumn objects (net_bu…
nilason 33f29c1
CI(Docker): Docker workflow improvements (#5128)
echoix 2854e29
CI: add macOS app bundle distribution workflow (#5118)
nilason 7bfe274
docker: hardcode versioned GISBASE path on Alpine (#5137)
nilason 938b9ad
gui(web_services): Fix not all arguments converted during string form…
echoix 4d49111
style: Fixed context opening error in wxGUI/dbmgr (#5062)
arohanajit 688e625
docs: fixing no-inline-html liniting error, part 1 (#5120)
petrasovaa cdf9fe7
g.extension: Fix Markdown compilation for addons (#5141)
petrasovaa c1da5fd
docs: mkdocs edit and view on github (#5114)
cwhite911 41c4b1d
docs: fix no-emphasis-as-heading in Markdown files (#5140)
petrasovaa bfe6ba0
r.in.srtm: Fixed SIM115, FURB103, FLY002 by adding context manager, f…
arohanajit ea470fa
docs: fix missed MD051/link-fragments (#5147)
petrasovaa 5f4fa06
docs: fix no-inline-html (span tag only) (#5148)
petrasovaa 83e7fe7
CI(Docker): Simplify job names with only the OS (#5156)
echoix de7a97a
docs: fix remaining no-inline-html (#5149)
petrasovaa 1633be4
docs: fix no-alt-text (#5154)
petrasovaa ff9659d
Added tests for v.build module
Shreshth-Malik 01246cb
Added fixes and suggestions
Shreshth-Malik 3ffdc09
Patch for failing test due to temp map name
Shreshth-Malik cb70e67
Fixed output parsing
Shreshth-Malik 93bb233
Fixed build fails due to temp meta data
Shreshth-Malik 21a5ba7
Moved build_module calculation and added fixes
Shreshth-Malik e67a95e
Merge branch 'v.build-test' of https://github.com/Shreshth-Malik/gras…
Shreshth-Malik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import grass.script as gs | ||
from grass.gunittest.case import TestCase | ||
from grass.gunittest.main import test | ||
|
||
|
||
class TestVBuild(TestCase): | ||
"""Test v.build output against expected output stored in vbuild_output""" | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
"""Set up a temporary region and create vector map with test features.""" | ||
cls.use_temp_region() | ||
input_data = "P 1\n1 1\nL 2\n0.5 0.5\n2.5 2.5" | ||
gs.write_command( | ||
"v.in.ascii", | ||
input="-", | ||
format="standard", | ||
stdin=input_data, | ||
output="test_3x3_map", | ||
flags="n", | ||
overwrite=True, | ||
) | ||
|
||
# Run v.build (with multiple dump options) and store its output in a class variable. | ||
cls.build_module = gs.read_command( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be executed in the |
||
"v.build", | ||
map="test_3x3_map", | ||
option="build,dump,sdump,cdump,fdump", | ||
quiet=True, | ||
).strip() | ||
|
||
# Read the expected output. | ||
cls.vbuild_output = """ | ||
N,S,E,W,T,B: 2.500000, 0.500000, 2.500000, 0.500000, 0.000000, 0.000000 | ||
----------------------------------- | ||
Nodes (2 nodes, alive + dead): | ||
node = 1, n_lines = 1, xyz = 0.500000, 0.500000, 0.000000 | ||
line = 2, type = 2, angle = 0.785398 (45.0000) | ||
node = 2, n_lines = 1, xyz = 2.500000, 2.500000, 0.000000 | ||
line = -2, type = 2, angle = -2.356194 (225.0000) | ||
----------------------------------- | ||
Lines (2 lines, alive + dead): | ||
line = 1, type = 1, offset = 18 | ||
line = 2, type = 2, offset = 35, n1 = 1, n2 = 2 | ||
----------------------------------- | ||
Areas (0 areas, alive + dead): | ||
----------------------------------- | ||
Islands (0 islands, alive + dead): | ||
---------- SPATIAL INDEX DUMP ---------- | ||
Nodes | ||
Node level=0 count=2 | ||
Branch 0 id = 1 0.500000 0.500000 0.000000 0.500000 0.500000 0.000000 | ||
Branch 1 id = 2 2.500000 2.500000 0.000000 2.500000 2.500000 0.000000 | ||
Lines | ||
Node level=0 count=2 | ||
Branch 0 id = 1 1.000000 1.000000 0.000000 1.000000 1.000000 0.000000 | ||
Branch 1 id = 2 0.500000 0.500000 0.000000 2.500000 2.500000 0.000000 | ||
Areas | ||
Node level=0 count=0 | ||
Isles | ||
Node level=0 count=0 | ||
---------- CATEGORY INDEX DUMP: Number of layers: 1 -------------------------------------- | ||
Layer 0 number of unique cats: 1 number of cats: 2 number of types: 2 | ||
------------------------------------------------------------------------------------------ | ||
type | count | ||
1 | 1 | ||
2 | 1 | ||
category | type | line/area | ||
0 | 1 | 1 | ||
0 | 2 | 2 | ||
------------------------------------------------------------------------------------------""" | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
"""Remove created vector map and temporary files, then delete the temp region.""" | ||
gs.run_command("g.remove", type="vector", flags="f", name="test_3x3_map") | ||
cls.del_temp_region() | ||
|
||
def test_vbuild_output(self): | ||
"""Compare the v.build output (build_module) to the expected output.""" | ||
self.assertMultiLineEqual(self.build_module[135:], self.vbuild_output) | ||
|
||
|
||
if __name__ == "__main__": | ||
test() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use read_command, the output is not meant to be parsed into a dictionary.