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 integration tests #240

Merged
merged 25 commits into from
Jun 6, 2023
Merged

Add integration tests #240

merged 25 commits into from
Jun 6, 2023

Conversation

ykim-1
Copy link
Contributor

@ykim-1 ykim-1 commented Apr 12, 2023

📝 Description

Adding integration tests - more details at:https://jira.linode.com/browse/TPT-1831

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?

How do I run the relevant unit/integration tests?

📷 Preview

If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.

@zliang-akamai
Copy link
Member

Can you fix the lint?

@zliang-akamai
Copy link
Member

zliang-akamai commented Apr 28, 2023

Try make format? Is this PR an in-progress work? I saw some empty files...

Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

Great work so far!
Since this is such a large PR I'll try to get the rest of my review out tomorrow 👍

NOTE: I think there needs to be an empty __init__.py file in test/integration to get imports working

requirements.txt Outdated Show resolved Hide resolved
test/integration/conftest.py Outdated Show resolved Hide resolved
test/integration/conftest.py Outdated Show resolved Hide resolved
test/integration/models/test_database.py Outdated Show resolved Hide resolved
test/integration/linode_client/test_linode_client.py Outdated Show resolved Hide resolved
test/integration/models/test_account.py Outdated Show resolved Hide resolved
test/integration/models/test_account.py Outdated Show resolved Hide resolved
test/integration/models/test_account.py Outdated Show resolved Hide resolved
test/integration/models/test_account.py Outdated Show resolved Hide resolved
test/integration/models/test_domain.py Outdated Show resolved Hide resolved
Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

Here's the second half 🙂

test/integration/models/test_lke.py Outdated Show resolved Hide resolved
test/integration/models/test_lke.py Outdated Show resolved Hide resolved
test/integration/models/test_lke.py Outdated Show resolved Hide resolved
test/integration/models/test_lke.py Outdated Show resolved Hide resolved
test/integration/models/test_linode.py Show resolved Hide resolved
test/integration/models/test_linode.py Show resolved Hide resolved
test/integration/models/test_linode.py Outdated Show resolved Hide resolved
Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

Looks great! I found these two issues when running the test suite, but otherwise things are passing 🎉

test/integration/models/test_linode.py Outdated Show resolved Hide resolved
test/integration/models/test_domain.py Outdated Show resolved Hide resolved
Comment on lines 31 to 46
assert re.search("[a-zA-Z]+", account.first_name)
assert re.search("[a-zA-Z]+", account.last_name)
assert re.search(
"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$", account.email
)
assert re.search(
"^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$", account.phone
)
assert re.search("[a-zA-Z0-9]+", account.address_1)
assert re.search("[a-zA-Z0-9]+", account.address_2)
assert re.search("[a-zA-Z]+", account.city)
assert re.search("[a-zA-Z]+", account.state)
assert re.search("[a-zA-Z]+", account.country)
assert re.search("[a-zA-Z0-9]+", account.zip)
if account.tax_id:
assert re.search("[0-9]+", account.tax_id)
Copy link
Member

@zliang-akamai zliang-akamai Jun 5, 2023

Choose a reason for hiding this comment

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

Be aware that some account may have these attribute as empty strings...

And we also have test_get_account in test/integration/models/test_account.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah but we are using two different ways to get account details.
E.g.
account = client.account()
account = client.load(Account, account_id)

I updated the regex so it can check empty string as well

Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

All tests are passing, nice work!

@ykim-1 ykim-1 merged commit 66df89e into dev Jun 6, 2023
7 checks passed
@zliang-akamai zliang-akamai deleted the add-integration-tests branch October 25, 2023 17:56
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.

None yet

4 participants