Hi folks, I'd probably like to work on this plugin...
# lucee
j
Hi folks, I'd probably like to work on this plugin https://github.com/lucee/extension-image but a few things are turning me off, at first glance: • There are no unit tests. (I see a little CFC integration test, but no unit tests.) That would make for a very clunky development workflow. Also the lack of tests is a recipe for regressions. • Ant 🤮 • External library dependencies included in the repository (https://github.com/lucee/extension-image/tree/master/source/java/libs -- probably a side effect of not using gradle or maven). I have always had bad experiences working on projects that have this arrangement. Am I misreading things? Are other official extensions in a similar state? Is there anything on the roadmap for improving the extension development experience? (Attn: @zackster)
💯 1
z
there are 270 tests run as part of the CI https://github.com/lucee/extension-image/actions/runs/3575765432/jobs/6012718094#step:9:213 our tests are cfml based, most tests are in the lucee core, we also (have after a lot of work from me) the ability to also run CI with tests from core and the local repo for lucee extensions (or locally via lucee/script-runner)
always happy to improve
j
@zackster, i just came back to mention that i'd found those integration tests, thanks. here's where i am as of this moment: https://gist.github.com/jamiejackson/d87d6fef7cff96c430c2effa5bd055c9
i don't think the tests are running as intended, but i'm also not sure i'm interpreting the extension development docs correctly. can you see what i'm doing wrong?
z
this is what i'm using locally
j
okay, i'm translating to bash and will try it out
z
probably worth using 6.0.0.300
j
does the lucee source checkout need to be on 6.0.0.300? i'm not sure what the -DluceeVersion flag is for
z
well the tests are more or less in sync with head on both repos
luceeVersion is the engine used to run the tests
we use light so no other extensions are loaded, to eliminate any cross deps and it's faster
if you are good with gradl.... here's an apt first task https://github.com/drewnoakes/metadata-extractor/issues/593
as lucee uses osgi, micha often ends up having to wrap libs as osgi, i always try and ask the upstream libs to add the osgi metadata, but I'm mostly a cfml developer who ended up doing all this lucee stuff 🙂
it's an ongoing battle, but worth it for the flexibility it provides us with extensions https://luceeserver.atlassian.net/browse/LDEV-1526?focusedCommentId=52709
j
i'm not sure i'm "good" at gradle, but i do use it.
z
like me and osgi!
😄 1
j
i don't think i'm having any luck. i also don't know what i'm even supposed to be seeing, with regard to testing output, so maybe i'm having luck but don't know it. 🤷 https://gist.github.com/jamiejackson/d87d6fef7cff96c430c2effa5bd055c9
z
this is what i see when i run that batch
try running ant in debug mode
j
i made progress. updating gist...
z
try -Dexecute="bootstrap-tests.cfm"
no leadin /
j
tried that, too right after. failed similarly. should i expect to find a
bootstrap-tests.cfm
file in the lucee source?
z
-d for debug output
j
Copy code
[java]    [script] {"Extended_Info":"","Message":"Page [/bootstrap-tests.cfm] [/Users/jjackson/projects/lucee-dev/Lucee/test/bootstrap-tests.cfm] not found","Detail":"","MissingFileName_abs":"/Users/jjackson/projects/lucee-dev/Lucee/test/bootstrap-tests.cfm","additional":["Mapping":"/"],"MissingFileName_rel":"/bootstrap-tests.cfm","TagContext":[],"ErrorCode":"0","MissingFileName":"/bootstrap-tests.cfm","type":"missinginclude","StackTrace":"lucee.runtime.exp.MissingIncludeException: Page [/bootstrap-tests.cfm] [/Users/jjackson/projects/lucee-dev/Lucee/test/bootstrap-tests.cfm] not found
will try the -d
z
-Dwebroot="C:\work\lucee6\test"
contains bootstrap-tests.cfm
j
which version of lucee should i have checked out? i'm now on master and don't have such a file:
Copy code
$ ls -al ../../Lucee/test/
total 8
drwxr-xr-x   17 jjackson  staff    544 Nov 29 17:57 .
drwxr-xr-x   18 jjackson  staff    576 Nov 29 17:57 ..
-rw-r--r--    1 jjackson  staff      8 Nov 29 17:57 .gitignore
drwxr-xr-x    5 jjackson  staff    160 Nov 29 17:57 a_debug_build
drwxr-xr-x    4 jjackson  staff    128 Nov 29 17:56 artifacts
drwxr-xr-x    7 jjackson  staff    224 Nov 29 17:57 cache
drwxr-xr-x    5 jjackson  staff    160 Nov 29 17:57 components
drwxr-xr-x   12 jjackson  staff    384 Nov 29 17:57 datasource
drwxr-xr-x    3 jjackson  staff     96 Nov 29 17:57 extension
drwxr-xr-x  254 jjackson  staff   8128 Nov 29 17:57 functions
drwxr-xr-x   40 jjackson  staff   1280 Nov 29 17:57 general
drwxr-xr-x  159 jjackson  staff   5088 Nov 29 17:57 jira
drwxr-xr-x   19 jjackson  staff    608 Nov 29 17:57 legacy
drwxr-xr-x    3 jjackson  staff     96 Nov 29 16:56 lib
drwxr-xr-x    7 jjackson  staff    224 Nov 29 17:57 orm
drwxr-xr-x   23 jjackson  staff    736 Nov 29 17:57 tags
drwxr-xr-x  778 jjackson  staff  24896 Nov 29 17:57 tickets
6.0
j
let me check out 6.0
z
yep
j
that's more like it:
Copy code
[java]    [script] 
     [java]    [script] -------------- Start Tests -----------
     [java]    [script] Found 43 tests to run, filter took 7047ms
     [java]    [script] Found 1 additional tests to run
     [java]    [script]         test.functions.GetWriteableImageFormats          (skipped)
     [java]    [script] Could not find mediaLib accelerator wrapper classes. Continuing in pure Java mode.
     [java]    [script]         test.functions.ImageAddBorder    (1 tests passed in 1,347 ms)
     [java]    [script]         test.functions.ImageBlur         (4 tests passed in 163 ms)
     [java]    [script]         test.functions.imageClearRect    (2 tests passed in 1,048 ms)
     [java]    [script]         test.functions.imageCopy         (2 tests passed in 458 ms)
     [java]    [script]         test.functions.ImageCrop         (1 tests passed in 134 ms)
     [java]    [script]         test.functions.ImageDrawArc      (2 tests passed in 56 ms)
     [java]    [script]         test.functions.ImageDrawBeveledRect      (2 tests passed in 56 ms)
     [java]    [script]         test.functions.ImageDrawLine     (2 tests passed in 47 ms)
     [java]    [script]         test.functions.ImageDrawOval     (2 tests passed in 48 ms)
     [java]    [script]         test.functions.ImageDrawPoint    (2 tests passed in 46 ms)
     [java]    [script]         test.functions.ImageDrawText     (2 tests passed in 949 ms)
     [java]    [script]         test.functions.ImageFormats      (185 tests passed in 6,728 ms)
     [java]    [script]         test.functions.ImageGetEXIFTag   (1 tests passed in 264 ms)
     [java]    [script]         test.functions.ImageGetHeight    (4 tests passed in 45 ms)
     [java]    [script]         test.functions.ImageGetWidth     (4 tests passed in 43 ms)
     [java]    [script]         test.functions.imagePaste        (2 tests passed in 46 ms)
     [java]    [script]         test.functions.imageReadbase64   (2 tests passed in 110 ms)
     [java]    [script]         test.functions.ImageResize       (3 tests passed in 181 ms)
     [java]    [script]         test.functions.ImageRotate       (4 tests passed in 242 ms)
     [java]    [script]         test.functions.ImageRotateDrawingAxis    (2 tests passed in 54 ms)
     [java]    [script]         test.functions.ImageShearDrawingAxis     (2 tests passed in 57 ms)
     [java]    [script]         test.functions.imageWritebase64          (2 tests passed in 53 ms)
     [java]    [script]         test.functions.ToBinary          (1 tests passed in 216 ms)
     [java]    [script]         test.general.ImageFormatSupport Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/image4.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/image3.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/image2.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/image1.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/sample1.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/web-platform-tests/pattern.ogv 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/web-platform-tests/pattern.mp4 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/image4.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/image3.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/image2.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/image1.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/sample1.heic 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/web-platform-tests/pattern.ogv 
     [java]    [script] Image format not supported - /Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/context/temp/testImageFormats/web-platform-tests/pattern.mp4 
     [java]    [script]          (2 tests passed in 8,014 ms)
     [java]    [script]         test.jira.Jira2946       (2 tests passed in 36 ms)
     [java]    [script]         test.tickets.LDEV0006    (1 tests passed in 221 ms)
     [java]    [script]         test.tickets.LDEV0392    (1 tests passed in 128 ms)
     [java]    [script]         test.tickets.LDEV0585    (2 tests passed in 244 ms)
     [java]    [script]         test.tickets.LDEV0652    (1 tests passed in 193 ms)
     [java]    [script]         test.tickets.LDEV0898    (1 tests passed in 471 ms)
     [java]    [script]         test.tickets.LDEV1230    (2 tests passed in 75 ms)
     [java]    [script]         test.tickets.LDEV1342    (4 tests passed in 244 ms)
     [java]    [script]         test.tickets.LDEV1388    (3 tests passed in 9,107 ms)
     [java]    [script]         test.tickets.LDEV1390    (1 tests passed in 59 ms)
     [java]    [script]         test.tickets.LDEV1393    (2 tests passed in 272 ms)
     [java]    [script]         test.tickets.LDEV1476    (2 tests passed in 450 ms)
     [java]    [script]         test.tickets.LDEV1906    (1 tests passed in 19 ms)
     [java]    [script]         test.tickets.LDEV2228    (1 tests passed in 1 ms)
     [java]    [script]         test.tickets.LDEV2258    (5 tests passed in 88 ms)
     [java]    [script]         test.tickets.LDEV2310    (2 tests passed in 148 ms)
     [java]    [script]         test.tickets.LDEV3082    (2 tests passed in 43 ms)
     [java]    [script]         testAdditional.LDEV3931          (1 tests passed in 54 ms)
     [java]    [script] 
     [java]    [script] 
     [java]    [script] =============================================================
     [java]    [script] TestBox Version: 2.2.0+00021
     [java]    [script] Lucee Version: 6.0.0.300-SNAPSHOT
     [java]    [script] Java Version: 11.0.17
     [java]    [script] Total Execution time: (45 s)
     [java]    [script] Test Execution time: (33 s)
     [java]    [script] Average Test Overhead: (192 ms)
     [java]    [script] Total Test Overhead: (8,250 ms)
     [java]    [script] =============================================================
     [java]    [script] 
     [java]    [script] -> Bundles/Suites/Specs: 43/80/271
     [java]    [script] -> Pass:     270
     [java]    [script] -> Skipped:  1
     [java]    [script] -> Failures: 0
     [java]    [script] -> Errors:   0
     [java]    [script] -> JUnitReport: /Users/jjackson/projects/lucee-dev/Lucee/test/reports/junit-test-results.xml
     [java]    [script] -> Service [imap]        not available,          2 tests skipped
     [java]    [script] -> Service [pop]         not available,          1 tests skipped
     [java]    [script] 
     [java]    [script] -------------- Finished --------------
     [java]      [echo] ---------- 2022-11-29 18:23:39 - Lucee Stopping ----------
     [java] 
     [java] BUILD SUCCESSFUL
     [java] Total time: 1 minute 4 seconds
     [echo] WARNING: An illegal reflective access operation has occurred
     [echo] WARNING: Illegal reflective access by lucee.commons.lang.ClassUtil (jar:/Users/jjackson/projects/lucee-dev/script-runner/temp/lucee/lucee-server/patches/6.0.0.300-SNAPSHOT.lco) to constructor com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl()
     [echo] WARNING: Please consider reporting this to the maintainers of lucee.commons.lang.ClassUtil
     [echo] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
     [echo] WARNING: All illegal access operations will be denied in a future release
     [echo] Finished!
   [delete] Deleting directory /Users/jjackson/projects/lucee-dev/script-runner/temp

core:

BUILD SUCCESSFUL
Total time: 1 minute 8 seconds
z
cool!!!!!!!
if you feel like tweaking that docs page a bit, that would be great. i brain dumped that one out a while back and nobody had really ever asked me about it before
v2 has a lot of different codec engines, micha's latest commit allows experimental limiting the use of codecs via this.image.codecs=["jai"]; mainly for debugging. here's a little test harness
👍 1
j
i'm having trouble figuring out where the list of formats come from. for instance: https://github.com/lucee/Lucee/blob/02e4bc2a78afd157ffc3b322d50ebda7368c7c38/test/functions/ImageFormats.cfc#L85
taking a couple steps backward, @zackster, is
webp
thought to work in some combination of lucee/extension versions? the state of this ticket is unclear to me: https://luceeserver.atlassian.net/browse/LDEV-3961
if you feel like tweaking that docs page a bit, that would be great. i brain dumped that one out a while back and nobody had really ever asked me about it before
I didn't tweak that page but I made some extension-specific documentation tweaks in the extension's repo: https://github.com/lucee/extension-image/pull/22
👍 1
z
j
@zackster, did you see my two posts above, starting with: "i'm having trouble..." and "taking a couple steps..."
z
where the imageformat(true) gets it content?
j
hmm, not sure what you meant by that. but let me back up and ask another individual question in another thread, then i'll come back here...