Skip to content

#113 Added implementation for the SaaS Bucket.#116

Merged
ahsimb merged 16 commits intomainfrom
feature/113-saas-service-and-bucket
May 2, 2024
Merged

#113 Added implementation for the SaaS Bucket.#116
ahsimb merged 16 commits intomainfrom
feature/113-saas-service-and-bucket

Conversation

@ahsimb
Copy link
Copy Markdown

@ahsimb ahsimb commented Apr 30, 2024

closes #113

Submission Checklist

  • Bumped version number
  • Updated Documentation
  • Updated API Documentation
  • Updated the changelog

@ahsimb ahsimb added the feature Product feature label Apr 30, 2024
@ahsimb ahsimb self-assigned this Apr 30, 2024
Comment thread exasol/bucketfs/_buckets.py Outdated
Comment thread exasol/bucketfs/_buckets.py Outdated
Comment thread exasol/bucketfs/_buckets.py Outdated
Comment thread pyproject.toml
typeguard = "4.0.0"
saas-api=">=0.2.0"
# Temp.fix
httpx=">=0.27.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could the saas api also use requests?
Do we need async support? (If so we may also should migrate bucketfs to httpx at some point)

Copy link
Copy Markdown
Author

@ahsimb ahsimb May 2, 2024

Choose a reason for hiding this comment

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

I don't think we need the async support, based on the current definition of the BucketLike. May do in the future, but this is outside the scope of this ticket.

Comment on lines +60 to +95
def saas_test_database_id(saas_test_service_url, saas_test_token, saas_test_account_id) -> str:

with create_saas_test_client(
url=saas_test_service_url,
token=saas_test_token
) as client:
db: Optional[openapi.models.database.Database] = None
try:
db = create_saas_test_database(
account_id=saas_test_account_id,
client=client
)
# Wait till the database gets to the running state.
sleep_time = 600
small_interval = 20
max_wait_time = 2400
max_cycles = 1 + (max_wait_time - sleep_time) // small_interval
for _ in range(max_cycles):
time.sleep(sleep_time)
db = get_saas_database(
account_id=saas_test_account_id,
database_id=db.id,
client=client
)
if db.status == SaasStatus.RUNNING:
break
sleep_time = 30
else:
raise RuntimeError(f'Test SaaS database status is {db.status} '
f'after {max_wait_time} seconds.')
yield db.id
finally:
if db is not None:
delete_saas_database(
account_id=saas_test_account_id,
database_id=db.id,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

doesn't the saas api provide such a fixture?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not yet. It will soon. At which point we may want to update this repo. However, there is a bigger problem that we may need to address - the testing of the SaaS bucket can't be done in the normal check workflow of the Python Toolbox.

Comment thread test_saas/integration/test_path.py Outdated
Comment thread test_saas/integration/test_path.py Outdated
Comment thread test_saas/integration/test_path.py Outdated
Nicoretti
Nicoretti previously approved these changes May 2, 2024
Copy link
Copy Markdown

@Nicoretti Nicoretti left a comment

Choose a reason for hiding this comment

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

As discussed, based the outcome of your logger.debug("%s", "value") vs logger.debug("{}", "value") investigation, either update or merge.

@ahsimb ahsimb merged commit 989e886 into main May 2, 2024
@ahsimb ahsimb deleted the feature/113-saas-service-and-bucket branch May 2, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Product feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the SaaS Service and Bucket

3 participants