[GH-ISSUE #471] misc: about current tests state & more #123

Open
opened 2026-02-28 00:40:40 +03:00 by kerem · 5 comments
Owner

Originally created by @NemoDacremont on GitHub (Oct 8, 2025).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/471

I wish to add some features (CT templates and SDNs) to Telmate/terraform-provider-proxmox, however I figured out there might be some bugs in the SDK to make it happen.

In order to submit patches, I wish to add tests to make sure it works and make reviewing easier. To be able to run the tests correctly, I think it's important to be able to run a vm easily like with Vagrant, but the Vagrantfile in the project bootstraps proxmox 7 (and it happened to me to fail to bootstrap), and I believe SDNs appears in proxmox 8.

I've worked recently on NemoDacremont/proxmox-ve that try to support proxmox 8 with vagrant on virtualbox, this is a fork of rgl/proxmox-ve that dropped virtualbox recently.

So now I'm testing on this proxmox base image, and I find out that many tests to fail, by running the following command, I get many fails :

go clean -testcache && make test 2>&1 | tee out

output: https://gist.github.com/NemoDacremont/dfbca89c14bf1420faa78329460677e3 (note that failing Sdn tests are some I started to write but I didn't stash before running the command, and there might be 1 or 2 log.Println around)

I've already opened some issues, and I have some free time ahead of me so I'm going to continue to debug things and try to find root causes, I'll probably try to patch them.

I also would like to update the README, mainly the part about the cli and explain how to use the new one, since it's supposed to be deprecated.

Do you have comments about it @Tinyblargon ? Maybe some things are like they are for a reason.

Originally created by @NemoDacremont on GitHub (Oct 8, 2025). Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/471 I wish to add some features (CT templates and SDNs) to `Telmate/terraform-provider-proxmox`, however I figured out there might be some bugs in the SDK to make it happen. In order to submit patches, I wish to add tests to make sure it works and make reviewing easier. To be able to run the tests correctly, I think it's important to be able to run a vm easily like with Vagrant, but the Vagrantfile in the project bootstraps proxmox 7 (and it happened to me to fail to bootstrap), and I believe SDNs appears in proxmox 8. I've worked recently on [NemoDacremont/proxmox-ve](https://github.com/NemoDacremont/proxmox-ve) that try to support proxmox 8 with vagrant on virtualbox, this is a fork of [rgl/proxmox-ve](https://github.com/rgl/proxmox-ve) that dropped virtualbox recently. So now I'm testing on this proxmox base image, and I find out that many tests to fail, by running the following command, I get many fails : ``` go clean -testcache && make test 2>&1 | tee out ``` output: https://gist.github.com/NemoDacremont/dfbca89c14bf1420faa78329460677e3 (note that failing Sdn tests are some I started to write but I didn't stash before running the command, and there might be 1 or 2 log.Println around) I've already opened some issues, and I have some free time ahead of me so I'm going to continue to debug things and try to find root causes, I'll probably try to patch them. I also would like to update the README, mainly the part about the cli and explain how to use the new one, since [it's supposed to be deprecated](https://github.com/Telmate/proxmox-api-go/blob/master/docs/style-guide/cli.md). Do you have comments about it @Tinyblargon ? Maybe some things are like they are for a reason.
Author
Owner

@Tinyblargon commented on GitHub (Oct 8, 2025):

First off, really appreciate that you want to help out.

Bit of context: over the last 2 years, the upstream Terraform provider had a lot issues, which required my attention. The integration test suits fell behind as i used Terraform to debug.

Please keep in mind that the implementation of a lot of parts hasn't been finalized and are in conflict with the style guide. And therefore subjected to change.

Thank you for reporting the issues. If you are planning on picking them up, please say so in the issue so I can assign it to you. This way, no double work happens.

As for explaining the new CLI in the readme, that would be more than welcome.

If you have any further questions, feel free to ask 😀

<!-- gh-comment-id:3381462633 --> @Tinyblargon commented on GitHub (Oct 8, 2025): First off, really appreciate that you want to help out. Bit of context: over the last 2 years, the upstream Terraform provider had a lot issues, which required my attention. The integration test suits fell behind as i used Terraform to debug. Please keep in mind that the implementation of a lot of parts hasn't been finalized and are in conflict with the style guide. And therefore subjected to change. Thank you for reporting the issues. If you are planning on picking them up, please say so in the issue so I can assign it to you. This way, no double work happens. As for explaining the new CLI in the readme, that would be more than welcome. If you have any further questions, feel free to ask 😀
Author
Owner

@NemoDacremont commented on GitHub (Oct 8, 2025):

Ok perfect, I'll submit some patches and be clearer about picking the issues, I'm glad to help and that it's welcomed

<!-- gh-comment-id:3381541950 --> @NemoDacremont commented on GitHub (Oct 8, 2025): Ok perfect, I'll submit some patches and be clearer about picking the issues, I'm glad to help and that it's welcomed
Author
Owner

@NemoDacremont commented on GitHub (Oct 8, 2025):

Also, I have a question about making tests reproducible, idk proxmox policy about that but it seems like alpine-3.17default_20221129_amd64.tar.xz used in lxc test is not downloadable easily on newer proxmox version (or maybe just it isn't available since it's too old).

As I'm using my proxmox vagrant image, I'm tempted to bump the template to alpine-3.21-default_20241217_amd64.tar.xz, but I think it should be linked to a test environment defined in the project so everyone can reproduce the tests. How do you think it should be done ? Should the Vagrantfile be fixed or should the base be changed (ex: using rgl/proxmox-ve)

<!-- gh-comment-id:3381767450 --> @NemoDacremont commented on GitHub (Oct 8, 2025): Also, I have a question about making tests reproducible, idk proxmox policy about that but it seems like `alpine-3.17default_20221129_amd64.tar.xz` used in lxc test is not downloadable easily on newer proxmox version (or maybe just it isn't available since it's too old). As I'm using my proxmox vagrant image, I'm tempted to bump the template to `alpine-3.21-default_20241217_amd64.tar.xz`, but I think it should be linked to a test environment defined in the project so everyone can reproduce the tests. How do you think it should be done ? Should the Vagrantfile be fixed or should the base be changed (ex: using rgl/proxmox-ve)
Author
Owner

@Tinyblargon commented on GitHub (Oct 8, 2025):

For the CLI tests, we have a file you can customize for your specific environment.

The filename is a misnomer and should have comments.

The API tests should have something like this aswell (currently does not).

The idea of the lxc image is that it's the latest alpine image. The image name changes quite frequently as it's name includes the date/time it was build. Tests that require this image to be there should download it.

Because we support multiple versions of PVE and some versions have interesting behavior, I try to keep a fresh backup of every minor version.

https://github.com/Telmate/proxmox-api-go/blob/master/test%2Fcli%2Fconstants.go

<!-- gh-comment-id:3382125761 --> @Tinyblargon commented on GitHub (Oct 8, 2025): For the CLI tests, we have a file you can customize for your specific environment. The filename is a misnomer and should have comments. The API tests should have something like this aswell (currently does not). The idea of the lxc image is that it's the latest alpine image. The image name changes quite frequently as it's name includes the date/time it was build. Tests that require this image to be there should download it. Because we support multiple versions of PVE and some versions have interesting behavior, I try to keep a fresh backup of every minor version. https://github.com/Telmate/proxmox-api-go/blob/master/test%2Fcli%2Fconstants.go
Author
Owner

@Tinyblargon commented on GitHub (Oct 8, 2025):

The idea is that you give the test suite root@pam login access. If there are any resources it needs, the tests should download it. If it needs users with specific permissions, it should create them.

<!-- gh-comment-id:3382152580 --> @Tinyblargon commented on GitHub (Oct 8, 2025): The idea is that you give the test suite `root@pam` login access. If there are any resources it needs, the tests should download it. If it needs users with specific permissions, it should create them.
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#123
No description provided.