cloudinary / cloudinary/cloudinary-cli

Cloudinary Test Cloud returns invalid Public IDs

未關閉
#65 8 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
3
分支
0
平均合併
11 分鐘
30 天內合併 PR
1

描述

## Bug report for Cloudinary CLI

This is not necessarily an issue with the Cloudinary CLI itself, but with the test cloud it runs against.

## Describe the bug in a sentence or two.

I found that the Test cloud returns invalid/inconsistent public ids for assets, especially when compared to running the same commands against a real Cloudinary account/enviroment. This impacts the ability to write accurate tests. I experienced this while trying to write tests for #63 .

## Issue Type (Can be multiple)
- [ ] Build - Cannot install or import the SDK
- [ ] Performance - Performance issues
- [ ] Behaviour - Functions are not working as expected (such as generate URL)
- [ ] Documentation - Inconsistency between the docs and behaviour
- [x] Other (Cloudinary Cloud)

## Steps to reproduce
1. Run the `test_cli_upload_dir` command using the test Cloudinary environment (provided by running `./tools/get_test_cloud.sh`). Note the command's output (by dumping/inspecting `output.result`).:

```
Uploading directory '/Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync'
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_10966/test_sync/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Ek_Bremen_P+R Syke_200x200.jpg as test_upload_dir_10966/test_sync/Ek_Bremen_P+R Syke_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/NoSpaces/OrdinaryFilename.png as test_upload_dir_10966/test_sync/NoSpaces/OrdinaryFilename
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Philips Lifetime_200x150.jpg as test_upload_dir_10966/test_sync/Philips Lifetime_200x150
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/SomeName/(02)-some-real_File-Name-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_10966/test_sync/SomeName/(02)-some-real_File-Name-Zone-(2.3.2)_378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Speed_Grip 3_05_200x200.jpg as test_upload_dir_10966/test_sync/Speed_Grip 3_05_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/hymer-1-2_)_98x63.jpg as test_upload_dir_10966/test_sync/hymer-1-2_)_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/specialCharactersätstest_1234/Einzelkritiken/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_10966/test_sync/specialCharactersätstest_1234/Einzelkritiken/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test with spaces/test_space 3_05_200x200.jpg as test_upload_dir_10966/test_sync/test with spaces/test_space 3_05_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test-h7/Philips Lifetime_200x150.jpg as test_upload_dir_10966/test_sync/test-h7/Philips Lifetime_200x150
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test_underscores____test/Ek_Bremen_P+R Syke_200x200.jpg as test_upload_dir_10966/test_sync/test_underscores____test/Ek_Bremen_P+R Syke_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/wohnmobil-2010/hymer-1-2_)_98x63.jpg as test_upload_dir_10966/test_sync/wohnmobil-2010/hymer-1-2_)_98x63
/usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py:265: ResourceWarning: unclosed running multiprocessing pool
_warn(f"unclosed running multiprocessing pool {self!r}",
ResourceWarning: Enable tracemalloc to get the object allocation traceback
12 resources uploaded
```

2. Run the same `test_cli_upload_dir` command using a real Cloudinary environment (from https://cloudinary.com/console). Note the command's output (by dumping/inspecting `output.result`).:

```
Uploading directory '/Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync'
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_86886/test_sync/02_-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-_2.3.2__378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Ek_Bremen_P+R Syke_200x200.jpg as test_upload_dir_86886/test_sync/Ek_Bremen_P_R_Syke_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/NoSpaces/OrdinaryFilename.png as test_upload_dir_86886/test_sync/NoSpaces/OrdinaryFilename
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Philips Lifetime_200x150.jpg as test_upload_dir_86886/test_sync/Philips_Lifetime_200x150
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/SomeName/(02)-some-real_File-Name-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_86886/test_sync/SomeName/02_-some-real_File-Name-Zone-_2.3.2__378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Speed_Grip 3_05_200x200.jpg as test_upload_dir_86886/test_sync/Speed_Grip_3_05_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/hymer-1-2_)_98x63.jpg as test_upload_dir_86886/test_sync/hymer-1-2___98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/specialCharactersätstest_1234/Einzelkritiken/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_86886/test_sync/specialCharactersätstest_1234/Einzelkritiken/02_-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-_2.3.2__378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test with spaces/test_space 3_05_200x200.jpg as test_upload_dir_86886/test_sync/test with spaces/test_space_3_05_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test-h7/Philips Lifetime_200x150.jpg as test_upload_dir_86886/test_sync/test-h7/Philips_Lifetime_200x150
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test_underscores____test/Ek_Bremen_P+R Syke_200x200.jpg as test_upload_dir_86886/test_sync/test_underscores____test/Ek_Bremen_P_R_Syke_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/wohnmobil-2010/hymer-1-2_)_98x63.jpg as test_upload_dir_86886/test_sync/wohnmobil-2010/hymer-1-2___98x63
/usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py:265: ResourceWarning: unclosed running multiprocessing pool
_warn(f"unclosed running multiprocessing pool {self!r}",
ResourceWarning: Enable tracemalloc to get the object allocation traceback
12 resources uploaded
```

3. Compare and note that the test cloud environment returns different Public IDs. Sometimes invalid. For example, note how the characters `)`, `(`, `+`, ` ` (spaces) in the file names are treated differently by each environment.

## Error screenshots or Stack Trace (if applicable)

## Operating System
- [ ] Linux
- [ ] Windows
- [ ] macOS
- [ ] All

## Environment and Frameworks (fill in the version numbers)

- Cloudinary CLI version - 0.0.0
- Cloudinary Python SDK version - 0.0.0
- Python Version - 3.9

## Repository

If possible, please provide a link to a reproducible repository that showcases the problem

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從 test_cli_upload_dir 命令、test/resources/test_sync fixtures 以及由 ./tools/get_test_cloud.sh 建立的測試環境開始。將測試 cloud 中的 output.result 與真實的 Cloudinary 環境進行比較,重點關注特殊字元和空格對應的 Public IDs。完成的標準是測試環境及其測試能夠一致產生有效且可比較的 Public IDs。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
cli, testing-qa
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。