public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager 0/2] fix tests and run them on package build
@ 2025-10-29 13:14 Christian Ebner
  2025-10-29 13:14 ` [pdm-devel] [PATCH datacenter-manager 1/2] server: api: fix test for is remote only cases Christian Ebner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christian Ebner @ 2025-10-29 13:14 UTC (permalink / raw)
  To: pdm-devel

Fixes the is_remotes_only() test by adapting the expected test
outcome. The outcome did change because of a code change, but the
test was forgotten to be adapted as well, but overlooked since
tests are not automatically run on package build.

Fix that as well by defining the `test` target in the Makefile.

Christian Ebner (2):
  server: api: fix test for is remote only cases
  build-sys: add make target for test

 Makefile                    | 5 +++++
 server/src/api/resources.rs | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pdm-devel] [PATCH datacenter-manager 1/2] server: api: fix test for is remote only cases
  2025-10-29 13:14 [pdm-devel] [PATCH datacenter-manager 0/2] fix tests and run them on package build Christian Ebner
@ 2025-10-29 13:14 ` Christian Ebner
  2025-10-29 13:14 ` [pdm-devel] [PATCH datacenter-manager 2/2] build-sys: add make target for test Christian Ebner
  2025-10-29 13:50 ` [pdm-devel] applied-series: [PATCH datacenter-manager 0/2] fix tests and run them on package build Wolfgang Bumiller
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Ebner @ 2025-10-29 13:14 UTC (permalink / raw)
  To: pdm-devel

Commit 636fd952 ("server: api: resources: improve search when
searching for remotes") changed the filtering logic so that a
search with category being 'remote' did not classify as 'remote
only'. This change was however not reflected in the test cases.

Fix this by updating the test case.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 server/src/api/resources.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs
index 3502c3b..1154aad 100644
--- a/server/src/api/resources.rs
+++ b/server/src/api/resources.rs
@@ -1108,8 +1108,8 @@ mod tests {
         let cases = vec![
             (vec![other_term.clone()], false),
             (vec![other_term_optional.clone()], false),
-            (vec![remote_term.clone()], true),
-            (vec![remote_term_optional.clone()], true),
+            (vec![remote_term.clone()], false),
+            (vec![remote_term_optional.clone()], false),
             (vec![type_other_term.clone()], false),
             (vec![type_other_term_optional.clone()], false),
             (
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pdm-devel] [PATCH datacenter-manager 2/2] build-sys: add make target for test
  2025-10-29 13:14 [pdm-devel] [PATCH datacenter-manager 0/2] fix tests and run them on package build Christian Ebner
  2025-10-29 13:14 ` [pdm-devel] [PATCH datacenter-manager 1/2] server: api: fix test for is remote only cases Christian Ebner
@ 2025-10-29 13:14 ` Christian Ebner
  2025-10-29 13:50 ` [pdm-devel] applied-series: [PATCH datacenter-manager 0/2] fix tests and run them on package build Wolfgang Bumiller
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Ebner @ 2025-10-29 13:14 UTC (permalink / raw)
  To: pdm-devel

This will be called during package build via `dh_auto_test` by
`dpkg-buildpackage` [0] and runs the tests defined in the workspace.

Based on the same target to be found in proxmox-backup's makefile.

[0] https://manpages.debian.org/trixie/debhelper/dh_auto_test.1.en.html

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Makefile b/Makefile
index 97c4a92..b2f794a 100644
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,8 @@ BASH_COMPLETIONS := $(addsuffix .bc,$(USR_BIN) $(USR_SBIN) $(SERVICE_BIN))
 ZSH_COMPLETIONS := $(addprefix _,$(USR_BIN) $(USR_SBIN) $(SERVICE_BIN))
 SHELL_COMPLETION_FILES := $(addprefix $(COMPLETION_DIR)/,$(BASH_COMPLETIONS) $(ZSH_COMPLETIONS))
 
+tests ?= --workspace
+
 all:
 
 install: $(COMPILED_BINS) $(SHELL_COMPLETION_FILES)
@@ -158,3 +160,6 @@ deb-ui: $(UI_DIR)
 dsc-ui: $(UI_DIR)
 	$(MAKE) -C $(UI_DIR) dsc
 	dcmd mv $(UI_DIR)/proxmox-datacenter-manager-ui*.dsc .
+
+test:
+	$(CARGO) test $(tests) $(CARGO_BUILD_ARGS)
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pdm-devel] applied-series: [PATCH datacenter-manager 0/2] fix tests and run them on package build
  2025-10-29 13:14 [pdm-devel] [PATCH datacenter-manager 0/2] fix tests and run them on package build Christian Ebner
  2025-10-29 13:14 ` [pdm-devel] [PATCH datacenter-manager 1/2] server: api: fix test for is remote only cases Christian Ebner
  2025-10-29 13:14 ` [pdm-devel] [PATCH datacenter-manager 2/2] build-sys: add make target for test Christian Ebner
@ 2025-10-29 13:50 ` Wolfgang Bumiller
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Bumiller @ 2025-10-29 13:50 UTC (permalink / raw)
  To: Christian Ebner; +Cc: pdm-devel

applied series, thanks

On Wed, Oct 29, 2025 at 02:14:00PM +0100, Christian Ebner wrote:
> Fixes the is_remotes_only() test by adapting the expected test
> outcome. The outcome did change because of a code change, but the
> test was forgotten to be adapted as well, but overlooked since
> tests are not automatically run on package build.
> 
> Fix that as well by defining the `test` target in the Makefile.
> 
> Christian Ebner (2):
>   server: api: fix test for is remote only cases
>   build-sys: add make target for test
> 
>  Makefile                    | 5 +++++
>  server/src/api/resources.rs | 4 ++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> -- 
> 2.47.3


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-29 13:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-29 13:14 [pdm-devel] [PATCH datacenter-manager 0/2] fix tests and run them on package build Christian Ebner
2025-10-29 13:14 ` [pdm-devel] [PATCH datacenter-manager 1/2] server: api: fix test for is remote only cases Christian Ebner
2025-10-29 13:14 ` [pdm-devel] [PATCH datacenter-manager 2/2] build-sys: add make target for test Christian Ebner
2025-10-29 13:50 ` [pdm-devel] applied-series: [PATCH datacenter-manager 0/2] fix tests and run them on package build Wolfgang Bumiller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal