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

Test the https-availability nibble-query #4028

Conversation

Donnype
Copy link
Contributor

@Donnype Donnype commented Jan 15, 2025

Changes

Small fix merging in a feature branch.

Use or-join to make the tests pass
@Donnype Donnype requested a review from a team as a code owner January 15, 2025 14:38
Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. I'm no expert in the queries, but did take a look at the tests.

While looking at this I had a couple of thoughts for potential improvements or something to think about (for later):

  • ip_generator could be a nice fixture on 'function' scope level to be used by multiple tests
  • test_https_availability_query might be a good example for test parameterization, but in this case maybe too complex/ abstract


if os.environ.get("CI") != "1":
pytest.skip("Needs XTDB multinode container.", allow_module_level=True)

STATIC_IP = ".".join((4 * "1 ").split())
STATIC_IP = ".".join(4 * ["1"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just write 1.1.1.1 here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we write it that way is not to have SonarCloud report a "static ip security vulnerability".


for _ in range(12):
create_port(xtdb_ooi_repository, next(ip), 443, valid_time)
assert xtdb_ooi_repository.session.client.query(query)[0][-1] == 13
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@originalsouth Or should this be 1 since the ips we created are not attached to the hostname through the website?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the ipaddress should be a parameter in the or-join, I'll check.

Copy link
Contributor

@originalsouth originalsouth Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the query breaks with more than one targets, let me check...

Donnype and others added 4 commits January 28, 2025 16:30
…ity-query' into fix/test-nibbles-https-availability-query

# Conflicts:
#	octopoes/tests/integration/test_https_availability_nibble.py
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@originalsouth originalsouth merged commit 5c8cd8a into feature/nibbles-https-availability Jan 29, 2025
32 of 33 checks passed
@originalsouth originalsouth deleted the fix/test-nibbles-https-availability-query branch January 29, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants