Boavizta / cloud-scanner

📡 Get Boavizta impact data for your aws cloud account usage.
GNU Affero General Public License v3.0
32 stars 7 forks source link

Update end to end tests for Boavizta API release #467

Closed demeringo closed 3 months ago

demeringo commented 3 months ago

Problem

Latest Boavizta Boavizta API release brings an updated calculation method of embedded impacts of CPU.

https://github.com/Boavizta/boaviztapi/releases/tag/v1.2.4

The returned values slighty changed, and this breaks the end to end test (which uses latest API by default).

---- boavizta_api_v1::tests::should_retrieve_raw_default_impacts_aws_fr stdout ----
thread 'boavizta_api_v1::tests::should_retrieve_raw_default_impacts_aws_fr' panicked at cloud-scanner-cli/src/boavizta_api_v1.rs:359:9:

json atoms at path ".impacts.gwp.embedded.max" are not equal:
    expected:
        0.002547
    actual:
        0.002545

json atoms at path ".impacts.gwp.embedded.min" are not equal:
    expected:
        0.0009013
    actual:
        0.0008995

json atoms at path ".impacts.pe.embedded.max" are not equal:
    expected:
        0.03333
    actual:
        0.03331

json atoms at path ".impacts.pe.embedded.min" are not equal:
    expected:
        0.01188
    actual:
        0.01186

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    boavizta_api_v1::tests::should_retrieve_raw_default_impacts_aws_fr

Solution

Update the test values.

This seems consistent with the update on the API tests https://github.com/Boavizta/boaviztapi/pull/279/files#

Alternatives

Additional context or elements