# CloudQuery test case error related to gcp\_networkconnectivity\_internal\_ranges

**URL:** <https://community.cloudquery.io/t/cloudquery-test-case-error-related-to-gcp-networkconnectivity-internal-ranges/632>\
**Category:** CloudQuery Plugins\
**Created:** [October 25, 2023, 11:52am UTC](https://community.cloudquery.io/t/cloudquery-test-case-error-related-to-gcp-networkconnectivity-internal-ranges/632 "2023-10-25T11:52:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![expert-lacewing](https://avatars.discourse-cdn.com/v4/letter/e/eada6e/32.png) [@expert-lacewing](https://community.cloudquery.io/u/expert-lacewing)\
**Post date:** [October 25, 2023, 11:52am UTC](https://community.cloudquery.io/t/cloudquery-test-case-error-related-to-gcp-networkconnectivity-internal-ranges/632/1 "2023-10-25T11:52:26Z")

</div>

Hi \<@456226577798135808\> & Team,

I need some help with the unit tests for this PR: [cloudquery/cloudquery#14925](https://github.com/cloudquery/cloudquery/pull/14925/commits/e2eb37099f3ea2c9e2da39ec58102feadf111119).

I have added the test cases, and when I try to run them, I am getting the following error:

```auto
Oct 25 17:18:42.000000 INF top level table resolver started client=project:testProject table=gcp_networkconnectivity_locations
Oct 25 17:18:42.000000 ERR table resolver finished with error error="googleapi: got HTTP response code 404 with body: 404 page not found\n" client=project:testProject table=gcp_networkconnectivity_internal_ranges
Oct 25 17:18:42.000000 INF table sync finished client=project:testProject errors=0 resources=1 table=gcp_networkconnectivity_locations
Oct 25 17:18:42.000000 INF table sync finished client=project:testProject errors=1 resources=0 table=gcp_networkconnectivity_internal_ranges
    testing_validation.go:15: found empty column(s): [project_id create_time description ip_cidr_range labels name network overlaps peering prefix_length target_cidr_range update_time usage users] in gcp_networkconnectivity_internal_ranges

```

Is there anything I might be missing in the test case that could lead to this issue?

Note: The parent table `location` test is passing, but when I add the relation to the child table, I am noticing this error.

---

<div class="post-metadata">

**Author:** ![KernelKnight](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@KernelKnight](https://community.cloudquery.io/u/KernelKnight)\
**Post date:** [October 25, 2023, 12:02pm UTC](https://community.cloudquery.io/t/cloudquery-test-case-error-related-to-gcp-networkconnectivity-internal-ranges/632/2 "2023-10-25T12:02:15Z")

</div>

Hi @expert-lacewing! Check what data you actually get in the relation table (when casting parent item). Pointers & non-pointers, that sort of stuff.

---

<div class="post-metadata">

**Author:** ![expert-lacewing](https://avatars.discourse-cdn.com/v4/letter/e/eada6e/32.png) [@expert-lacewing](https://community.cloudquery.io/u/expert-lacewing)\
**Post date:** [October 25, 2023, 12:07pm UTC](https://community.cloudquery.io/t/cloudquery-test-case-error-related-to-gcp-networkconnectivity-internal-ranges/632/3 "2023-10-25T12:07:00Z")

</div>

Hi Alex,

I am getting all the internal ranges returned by the API as part of the relation table (`internalRange`).

Example row values:

```auto
2023-10-25 05:20:29.952462,gcp,a6021faa-c2e6-5525-ad06-bf1f8618d02d,b08011ac-08de-5de8-9d90-b9281860cfb0,<projectID>,2023-10-18T16:21:37.369908648Z,FOR_VPC and NOT_SHARED,10.10.0.0/,"{""key"": ""val""}",projects/<projectID>/locations/global/internalRanges/test-lan-ir,https://www.googleapis.com/compute/v1/projects/<projectID>/global/networks/vpc-1,,NOT_SHARED,0,,2023-10-18T16:21:38.290258900Z,FOR_VPC

```

I feel the error `googleapi: got HTTP response code 404 with body: 404 page not found` might be related to the path not matching in mock HTTP, but it seems I have given the correct path only.

---

<div class="post-metadata">

**Author:** ![KernelKnight](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@KernelKnight](https://community.cloudquery.io/u/KernelKnight)\
**Post date:** [October 25, 2023, 12:12pm UTC](https://community.cloudquery.io/t/cloudquery-test-case-error-related-to-gcp-networkconnectivity-internal-ranges/632/4 "2023-10-25T12:12:43Z")

</div>

You use `location.Name` in the resolver, while in the mock test you return the location ID.

See how KMS handles mock:

```go
https://github.com/cloudquery/cloudquery/blob/main/plugins/source/gcp/resources/services/kms/locations_mock_test.go#L23-L24

```

---

<div class="post-metadata">

**Author:** ![expert-lacewing](https://avatars.discourse-cdn.com/v4/letter/e/eada6e/32.png) [@expert-lacewing](https://community.cloudquery.io/u/expert-lacewing)\
**Post date:** [October 25, 2023, 12:20pm UTC](https://community.cloudquery.io/t/cloudquery-test-case-error-related-to-gcp-networkconnectivity-internal-ranges/632/5 "2023-10-25T12:20:10Z")

</div>

It worked after adding the location name in the mock. Many thanks for pointing it out. Please review it.

---

<div class="post-metadata">

**Author:** ![KernelKnight](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@KernelKnight](https://community.cloudquery.io/u/KernelKnight)\
**Post date:** [October 25, 2023, 12:59pm UTC](https://community.cloudquery.io/t/cloudquery-test-case-error-related-to-gcp-networkconnectivity-internal-ranges/632/6 "2023-10-25T12:59:40Z")

</div>

It got merged, thanks for the contribution!

The feature has been released as part of GCP `v9.9.0`.
