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

Organize testcontent dir + fix for description length issue #235 #245

Merged
merged 4 commits into from Feb 8, 2020

Conversation

ivanistheone
Copy link
Contributor

The channel validation/truncate_fileds normally happens later on in the upload process, so I added an early call to truncate_fields to avoid #235

I tested manually on command line. If description is > 400 chars, prints:

   Creating channel Sample Ricecooker Channel
		Channel sample-ricecooker-channel: description This channel was created from the files in the content/ dir and the metadata provided in Pythonalkjsalksjlakjs salksj lakjs lakjs lkajs lkaj alkjsalksjlakjs salksj lakjs lakjs lkajs lkaj alkjsalksjlakjs salksj lakjs lakjs lkajs lkaj alkjsalksjlakjs salksj lakjs lakjs lkajs lkaj alkjsalksjlakjs salksj lakjs lakjs lkajs lkaj alkjsalksjlakjs salksj lakjs lakjs lkajs lkaj babababaabab ab ababasj babababaabab ab ababasjbabababaabab ab ababasjbabababaabab ab ababasjbabababaabab ab ababasjbabababaabab ab ababasjbabababaabab ab ababasj babababaabab ab ababasj caococo caococo caococo caococo caococo caococo caococo caococo caococo caococo caococo caococo caococo caococo caococo caococo caococo caococo  dodoodododoaodao doao dodoodododoaodao doao dodoodododoaodao doao dodoodododoaodao doao dodoodododoaodao doao dodoodododoaodao doao dodoodododoaodao doao  is too long - max 400 characters (truncating)

and only first 400 chars got uploaded to Studio, see here.

@ivanistheone
Copy link
Contributor Author

ivanistheone commented Feb 6, 2020

@kollivier This morning I was trying to fix a flaky test file, and ended up implementing a good part of the cleanup you suggested in #243

This is what testcontent looks like before running any tests:

> tree -a tests/testcontent/

tests/testcontent/
├── downloaded
│   └── .gitkeep
├── exercises
│   ├── eb3f3bf7c317408ee90995b5bcf4f3a59606aedd-data.json
│   ├── eb3f3bf7c317408ee90995b5bcf4f3a59606aedd.svg
│   ├── no-wifi.png
│   ├── perseus_question_x43bbec76d5f14f88_bg.json
│   ├── perseus_question_x43bbec76d5f14f88_en.json
│   └── test_image_base64.data
├── generated
│   └── .gitkeep
└── samples
    ├── sample_doc_with_toc.pdf
    ├── testdocument.epub
    ├── testsubtitles_ar.srt
    ├── thumbnail.jpg
    └── thumbnail.png

And after running tests:

> tree -a tests/testcontent/

tests/testcontent/
├── downloaded
│   ├── .gitkeep
│   ├── 41568-pdf.pdf
│   ├── Beyond-Good-and-Evil-Galbraithcolor.pdf
│   ├── basic.srt
│   ├── basic.vtt
│   ├── encapsulated.sami
│   ├── encapsulated.vtt
│   ├── high_res_video.mp4
│   ├── low_res_ogv_video.ogv
│   ├── low_res_video.mp4
│   ├── testaudio.mp3
│   ├── testdocument.pdf
│   ├── testhtml.zip
│   ├── testsubtitles_ar
│   └── testsubtitles_ar.ttml
├── exercises
│   ├── eb3f3bf7c317408ee90995b5bcf4f3a59606aedd-data.json
│   ├── eb3f3bf7c317408ee90995b5bcf4f3a59606aedd.svg
│   ├── no-wifi.png
│   ├── perseus_question_x43bbec76d5f14f88_bg.json
│   ├── perseus_question_x43bbec76d5f14f88_en.json
│   └── test_image_base64.data
├── generated
│   ├── .gitkeep
│   ├── bad_video.mp4
│   ├── invalid_audio.mp3
│   ├── invalid_document.epub
│   ├── invalid_document.pdf
│   ├── invalid_video.mp4
│   ├── invalidimage.png
│   ├── slide0.jpg
│   ├── slide1.jpg
│   ├── slide2.jpg
│   ├── slide3.jpg
│   ├── slide4.jpg
│   ├── slide5.jpg
│   ├── slide6.jpg
│   ├── slide7.jpg
│   ├── slide8.jpg
│   ├── slide9.jpg
│   ├── testinvalidhtml.zip
│   ├── testsubtitles.vtt
│   └── unconvetible.sub
└── samples
    ├── sample_doc_with_toc.pdf
    ├── testdocument.epub
    ├── testsubtitles_ar.srt
    ├── thumbnail.jpg
    └── thumbnail.png

Running make clean-test puts us back into the initial state.


@pytest.fixture
def minimal_html_filename():
return 'b3f06ea298da23eee1d231795655e01b.zip'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixture was not used by any tests, so removing.

@ivanistheone ivanistheone changed the title Fix for description length issue #235 Organize testcontent dir + fix for description length issue #235 Feb 6, 2020
Copy link
Contributor

@kollivier kollivier left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@kollivier kollivier merged commit a246fe5 into learningequality:master Feb 8, 2020
@ivanistheone ivanistheone deleted the handle_more_errors branch February 10, 2020 15:20
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

2 participants