[PR #476] [MERGED] fix: fix api/lxc tests failing #496

Closed
opened 2026-02-28 00:42:25 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/476
Author: @NemoDacremont
Created: 10/9/2025
Status: Merged
Merged: 10/9/2025
Merged by: @Tinyblargon

Base: masterHead: fix/test-api_lxc


📝 Commits (4)

  • 12a95a3 refactor: move cli/constants.go to test/constants.go to share constants accross all tests
  • 6a7849e fix: download template before creating lxc and delete lxc template after creation
  • 3f985e8 fix(test): lower lxc storage to prevent failing from out of storage while testing
  • 6a0d584 fix: use -parallel 1 for tests to prevent race conditions on resource management

📊 Changes

7 files changed (+46 additions, -25 deletions)

View changed files

📝 Makefile (+1 -1)
📝 test/api/Lxc/lxc_create_update_delete_test.go (+11 -2)
📝 test/api/Lxc/lxc_start_test.go (+9 -2)
📝 test/api/Lxc/shared_test.go (+7 -4)
📝 test/cli/Content/Template/ContentTemplate_test.go (+11 -12)
test/cli/constants.go (+0 -4)
test/constants.go (+7 -0)

📄 Description

fixes #475

Did 3 things :

  • Bump DownloadedLXCTemplate from alpine-3.17-default_20221129_amd64.tar.xz to alpine-3.21-default_20241217_amd64.tar.xz
  • Refactor: Move cli/constants.go to constants.go to share CT templates constants accross api and cli tests
  • Refactor: Add osTemplate parameter in _create_lxc_spec to reuse the template from constants.go (and avoid referencing constants directly in the function body)
  • Fix first issue : Download tests CT template before running Create tests (in lxc_start_test.go and in lxc_create_update_delete_test.go)
  • Fix second issue : Remove the LXC template after testing in Test_Create_Template_Lxc_Container

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/476 **Author:** [@NemoDacremont](https://github.com/NemoDacremont) **Created:** 10/9/2025 **Status:** ✅ Merged **Merged:** 10/9/2025 **Merged by:** [@Tinyblargon](https://github.com/Tinyblargon) **Base:** `master` ← **Head:** `fix/test-api_lxc` --- ### 📝 Commits (4) - [`12a95a3`](https://github.com/Telmate/proxmox-api-go/commit/12a95a34fd2879a18a21cdd675da96999a053059) refactor: move cli/constants.go to test/constants.go to share constants accross all tests - [`6a7849e`](https://github.com/Telmate/proxmox-api-go/commit/6a7849e1e3bbb28b86d4a1c776813a2a4c521acf) fix: download template before creating lxc and delete lxc template after creation - [`3f985e8`](https://github.com/Telmate/proxmox-api-go/commit/3f985e8af663b85eaffc6a76750461ff24e8cf09) fix(test): lower lxc storage to prevent failing from out of storage while testing - [`6a0d584`](https://github.com/Telmate/proxmox-api-go/commit/6a0d58428c9bedfecba859a517632b0f4d7504ee) fix: use -parallel 1 for tests to prevent race conditions on resource management ### 📊 Changes **7 files changed** (+46 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `Makefile` (+1 -1) 📝 `test/api/Lxc/lxc_create_update_delete_test.go` (+11 -2) 📝 `test/api/Lxc/lxc_start_test.go` (+9 -2) 📝 `test/api/Lxc/shared_test.go` (+7 -4) 📝 `test/cli/Content/Template/ContentTemplate_test.go` (+11 -12) ➖ `test/cli/constants.go` (+0 -4) ➕ `test/constants.go` (+7 -0) </details> ### 📄 Description fixes #475 Did 3 things : * Bump `DownloadedLXCTemplate` from `alpine-3.17-default_20221129_amd64.tar.xz` to `alpine-3.21-default_20241217_amd64.tar.xz` * Refactor: Move `cli/constants.go` to `constants.go` to share CT templates constants accross api and cli tests * Refactor: Add `osTemplate` parameter in `_create_lxc_spec` to reuse the template from `constants.go` (and avoid referencing constants directly in the function body) * Fix first issue : Download tests CT template before running Create tests (in `lxc_start_test.go` and in `lxc_create_update_delete_test.go`) * Fix second issue : Remove the LXC template after testing in `Test_Create_Template_Lxc_Container` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:42:25 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#496
No description provided.