Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tests for DIREGAPIC Enums #433

Open
bshaffer opened this issue Jan 5, 2022 · 0 comments
Open

Add Tests for DIREGAPIC Enums #433

bshaffer opened this issue Jan 5, 2022 · 0 comments
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@bshaffer
Copy link
Contributor

bshaffer commented Jan 5, 2022

We are generating the new Enum classes for Compute, but we should also generate at least one test per service which ensures that these Enum classes look like we expect. For example, something like this:

// in Compute/tests/Unit/V1/Enums/EnumTest.php

namespace Google\Cloud\Compute\Tests\Unit\V1\Enums;

use Google\Cloud\Compute\V1\Enums;

class EnumTest extends TestCase
{
    public function testEnums()
    {
        $this->assertEquals('UNDEFINED_NETWORK_TIER', Enums\AccessConfig\NetworkTier::UNDEFINED_NETWORK_TIER);
        // ...
        // all the other enums
        // ...
        $this->assertEquals('UP', Enums\Zone\Status::UP);
    }
}

This provides a sanity check that the Enum classes do not contain any syntax errors. As the existing tests are only for InstanceClient classes, and the enum classes do not map to InstanceClient classes (as far as I know), the easiest way to implement these tests is to create an Enum test class for all of them.

@bshaffer bshaffer added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

1 participant