prometheus / prometheus

The Prometheus monitoring system and time series database.
https://prometheus.io/
Apache License 2.0
55.15k stars 9.08k forks source link

Add unit testing for AWS SD #14310

Open machine424 opened 3 months ago

machine424 commented 3 months ago

Proposal

It seems we’ve been relying on manual testing by maintainers and the community. I'm lacking context regarding this.

I don't think I need to explain the necessity of unit tests, but if they’re easy to implement, it’ll give us much more confidence when reviewing related PRs, especially when we’re not familiar with the API.

This will involve some research and discussions regarding the needed test utils (mocks etc.).

If aws-sdk-go-v2 provides better utils and makes testing easier than the currently used v1, we might have to wait until we migrate to v2 (v1 is expected to reach EOL in approximately 1 year).

chamodshehanka commented 3 months ago

Hi @machine424, I noticed that this issue has been labeled with help wanted and I'd like to contribute to this

akunszt commented 3 months ago

I started to work on it but only for a minimal amount of time, so if @chamodshehanka wants to take this over then it is fine by me. All I did is to changed to the ec2iface.EC2API interface which is implemented by the ec2.EC2. I think we should create the unit tests now for the v1 so the v2 migration later will be less painful.

chamodshehanka commented 3 months ago

I started to work on it but only for a minimal amount of time, so if @chamodshehanka wants to take this over then it is fine by me. All I did is to changed to the ec2iface.EC2API interface which is implemented by the ec2.EC2. I think we should create the unit tests now for the v1 so the v2 migration later will be less painful.

Awesome!