Skip to content

Commit 653096d

Browse files
committed
Add testcase for bad file format
1 parent a1b90dd commit 653096d

2 files changed

Lines changed: 34 additions & 3 deletions

File tree

‎_quick_build.yml‎

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ exclude:
2121
- _authors/deleanu-f.md
2222
- _authors/diamond-jared.md
2323
- _authors/gomtsul.md
24+
- _authors/gleig-a.md
2425
- _authors/huxley-a.md
2526
- _authors/iwamura-jane.md
26-
- _authors/khema.md
2727
- _authors/lew-karl.md
28-
- _authors/norman.md
2928
- _authors/rankine-claudia.md
3029
- _authors/shi-zhiru.md
3130
- _authors/sontag.md
@@ -41,9 +40,9 @@ exclude:
4140
- _authors/keeler-ward.md
4241
- _authors/king-winston.md
4342
- _authors/menzel-peter.md
44-
- _authors/mipham.md
4543
- _authors/popova.md
4644
- _authors/singer-peter.md
45+
- _authors/vasubandhu.md
4746
- _content/articles/astrological-determinism_kotyk-j.md
4847
- _content/articles/beginnings-of-the-buddhas-teachings-according-to-the-ea_bareau-andre.md
4948
- _content/articles/bill-gates-tweeted_matthews-dylan.md
@@ -363,4 +362,35 @@ exclude:
363362
- _content/reference/pressing-out-pure-honey_rogell-sharda.md
364363
- _content/reference/ticivara.md
365364
- _content/reference/tipitaka.md
365+
- _content/articles/sa-regarding-emptiness_lamotte.md
366+
- _content/av/buddhism-beyond-modernity_gleig-a.md
367+
- _content/av/fear-and-worry_pasanno.md
368+
- _content/av/feminism_solnit.md
369+
- _content/av/fifty-jataka_baker-phongpaichit.md
370+
- _content/av/great-indoors.md
371+
- _content/av/literature-of-gandhara_salomon-richard.md
372+
- _content/av/moral-panics_cottom-klein.md
373+
- _content/av/muslim-stereotypes-conceal-the-real-history_elverskog-johan.md
374+
- _content/av/tornado-of-self_panyavaddho.md
375+
- _content/av/values_jayasaro.md
376+
- _content/av/yasodhara_sasson-v.md
377+
- _content/booklets/single-bowl-of-sauce_buddhadasa.md
378+
- _content/canon/an6.45.md
379+
- _content/canon/karma-vibhanga.md
380+
- _content/canon/mn25.md
381+
- _content/canon/mv1-4.md
382+
- _content/canon/sn36.19.md
383+
- _content/canon/t1586.md
384+
- _content/essays/chan-practice-and-faith_sheng-yen.md
385+
- _content/essays/cushion-or-world_cintita.md
386+
- _content/essays/monet-refuses-the-operation_mueller-lisel.md
387+
- _content/monographs/buddhist-thought_williams-paul.md
388+
- _content/monographs/early-buddhist-transmission_neelis-jason.md
389+
- _content/monographs/li-bo-unkempt_smith-kidder.md
390+
- _content/articles/omniscience_analayo.md
391+
- _content/av/secret-identity_tal.md
392+
- _content/essays/ashokas-engineers_dhammika.md
393+
- _content/excerpts/samadhi_analayo.md
394+
- _content/excerpts/sati_analayo.md
395+
366396

‎_tests/content.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ A series of tests checking the integrity of the _content data
1010
| Count | {% if site.content.size > 100 %}Pass ✅{% else %}FAIL ❌{% endif %} | With {{ site.content.size }} items in the library. |
1111
| Excessive Authors | {% assign ea = site.content | where_exp: "c", "c.authors.size > 5" %}{% if ea.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | {% assign cout = '' | split: '' %}{% for c in ea %}{% assign cout = cout | push: c.path %}{% endfor %}Found {{ ea.size }} works with more than 5 authors{% if ea.size > 0 %}:{% else %}.{% endif %} {{ cout | array_to_sentence_string }}
1212
| Sane file_links | {% assign valid_buckets = "exclusive_01" | split: "," %}{% assign hostedcontent = site.content | where_exp: "c", "c.file_links.size > 0" %}{% assign fs = '' | split: '' %}{% for c in hostedcontent %}{% for l in c.file_links %}{% assign s = l | split: "/" %}{% unless valid_buckets contains s[0] %}{% assign fs = fs | push: c %}{% endunless %}{% endfor %}{% endfor %}{% if fs.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | {% assign count = hostedcontent.size | minus: fs.size %}{% if count > 0 %}There are {{ count }} sane links{% endif %}{% if fs.size > 0 %}The {{ fs.size }} pieces with bad buckets are: {% for c in fs %}[{{ c.title | split: ":" | first }}]({{ c.url }}) {% endfor %}{% endif %}
13+
| file_links match formats | {% assign fs = '' | split: '' %}{% for c in hostedcontent %}{% for l in c.file_links %}{% assign ee = l | split: "." | last %}{% unless ee == c.formats[forloop.index0] %}{% assign fs = fs | push: c %}{% endunless %}{% endfor %}{% endfor %}{% if fs.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | {% assign count = hostedcontent.size | minus: fs.size %}{% if count > 0 %}There are {{ count }} sane formats.{% endif %}{% if fs.size > 0 %} The {{ fs.size }} pieces with bad formats are: {% for c in fs %}[{{ c.title | split: ":" | first }}]({{ c.url }}) {% endfor %}{% endif %}
1314
| Missing Authors | {% assign expect = '' | split: '' %}{% for cont in site.content %}{% for auth in cont.authors %}{% unless auth contains " " %}{% unless expect contains auth %}{% assign expect = expect | push: auth %}{% endunless %}{% endunless %}{% endfor %}{% endfor %}{% assign grouped = expect | group_by_exp: "auth", "site.authors | where: 'slug', auth | size" %}{% for group in grouped %}{% if group.name == 0 %}{% assign failed = group.items %}{% else %}{% assign found = group.items %}{% endif %}{% endfor %}{% if expect.size == found.size %}Pass ✅{% else %}FAIL ❌{% endif %} | Of the {{ expect.size }} authors cited, {{ found.size }} of them are in the database. {% if failed.size > 0 %}Failed to find author pages for: {{ failed | array_to_sentence_string }}{% endif %}
1415
| Dangling Authors | {% assign authors = site.authors | map: "slug" %}{% for auth in found %}{% assign authors = authors | where_exp: "a", "a != auth" %}{% endfor %}{% assign unfound = '' | split: '' %}{% for auth in authors %}{% assign c = site.content | where: "translator", auth | size %}{% if c > 0 %}{% continue %}{% endif %}{% assign c = site.content | where: "editor", auth | size %}{% if c > 0 %}{% continue %}{% endif %}{% assign c = site.content | where: "reader", auth | size %}{% if c == 0 %}{% assign unfound = unfound | push: auth %}{% endif %}{% endfor %}{% if unfound.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | There are {{ unfound.size }} authors with no works attributed to them{% if unfound.size == 0 %}.{% else %}: {{ unfound | array_to_sentence_string }}.{% endif %}
1516
| Non-monograph content missing links | {% assign failures = site.content | where_exp: "c", "c.external_url == nil" | where_exp: "c", "c.drive_links == nil" | where_exp: "c", "c.source_url == nil" | where_exp: "c", "c.file_links == nil" | where_exp: "c", "c.category != 'monographs'" | where_exp: "c", "c.slug != 'baraka_fricke-ron'" | where_exp: "c", "c.slug != 'harvey'" %}{% if failures.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | Except for [_Baraka_](/content/av/baraka_fricke-ron) and [_Harvey_](/content/av/harvey) (known exceptions), there were {{ failures.size }} found{% if failures.size >0 %}: {{ failures | map: "slug" | array_to_sentence_string }}{% endif %}.

0 commit comments

Comments
 (0)