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 test to validate potential problem when requesting many vault files uploads #438

Merged
merged 1 commit into from
May 26, 2022

Conversation

fmigneault
Copy link
Collaborator

No description provided.

@fmigneault fmigneault requested a review from ahandan May 25, 2022 19:16
@fmigneault fmigneault self-assigned this May 25, 2022
@github-actions github-actions bot added ci/tests Tests of the package and features ci/doc Issue related to documentation of the package labels May 25, 2022
"""
test_data = json.dumps({"data": "test"}, ensure_ascii=False).encode("UTF-8")
headers = {"Accept": ContentType.APP_JSON} # multi-part content-type added automatically with boundary
for i in range(30):
Copy link

Choose a reason for hiding this comment

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

Est-ce que qu'on veut définir une variable Nombre_de_requête ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

On pourrait, mais je ne vois pas le besoin pour un test automatisé comme celui-ci.

# make sure access was not by chance
resp = self.app.get(url=f"/vault/{file_id}", expect_errors=True)
assert resp.status_code == 403
resp = self.app.get(url=f"/vault/{file_id}", headers={"X-Auth-Vault": token})
Copy link

Choose a reason for hiding this comment

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

Bien que ma machine était fautive, est-ce qu'on veut mettre un temps d'attente entre les deux requêtes ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Je pense que ce test (s'il y a problème) devrait lever le plus d'erreurs possible parce que ça s'exécute aussi vite que possible.
Je ne pense pas que l'ajout d'un délai vas changer le résultat.

@ahandan
Copy link

ahandan commented May 26, 2022

LGTM, à moins qu'on veuille avoir des tests plus larges, celui si est simple et test le vault convenablement selon moi.

@fmigneault fmigneault merged commit dc8a0cc into master May 26, 2022
@fmigneault fmigneault deleted the fast-vault-requests branch May 26, 2022 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/doc Issue related to documentation of the package ci/tests Tests of the package and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants