CenterForOpenScience / waterbutler

WaterButler is a Python web application for interacting with various file storage services via a single RESTful API, developed at Center for Open Science.
Apache License 2.0
62 stars 76 forks source link

[Q] WaterButler testing example #413

Closed hiroyuki-sato closed 2 months ago

hiroyuki-sato commented 2 months ago

Hello, team.

I want to do an automatic addon test using real S3-compatible storage. (I want to check an All APIs work on s3-compatible storage) It seems useful to use the WaterButler testing system.

I'm reading this document. https://waterbutler.readthedocs.io/en/latest/testing.html

Questions

  1. How to get PID?
  2. Does newman run tests/postman/collections/copy_files.json -e copy_file_sample.json run inside WaterButler image? (docker-compose upwb,quay.io/centerforopenscience/wb:develop`?)
  3. Any other execution examples?
  4. Any other resources?

Best regards.

hiroyuki-sato commented 2 months ago

Self solved.

  1. project ID is contained in the URL. (ex: Fig2. https://sites.google.com/a/case.edu/hpcc/guides-and-training/helpful-references/additional-resources/open-science-framework-osf?pli=1)
  2. postman is just a REST client. So, It requires a node command only.
  3. If you use OAuth instead of Basic auth, It is necessary to change the Authorization header.
diff --git a/tests/postman/collections/copy_files.json b/tests/postman/collections/copy_files.json
index 75b779f4..0fc3121e 100644
--- a/tests/postman/collections/copy_files.json
+++ b/tests/postman/collections/copy_files.json
@@ -34,7 +34,7 @@
                                                "header": [
                                                        {
                                                                "key": "Authorization",
-                                                               "value": "Basic {{basic_auth}}",
+                                                               "value": "Bearer {{basic_auth}}",
                                                                "description": ""
                                                        }
                                                ],