[x3d-public] x3dom testing and building

Andreas Plesch andreasplesch at gmail.com
Mon Oct 23 20:40:01 PDT 2017


Thinking more about how it could be possible to put the web3d example
archive to use for testing experimental x3dom script distributions
built automatically from submitted PRs, I found that it is possible to
fetch, modify and load web3d X3dom.xhtml example versions just using a
static html page:

https://x3dom-test.glitch.me/

This replaces the x3dom-full.js from x3dom.org with one from
x3dom-builds.surge.sh and loads the page in an iframe (as a data url).
There were quite a few pitfalls (mostly that iframes cannot take xhtml
as a srcdoc value) but it seems to work well now. Only url fields in
nodes do not get loaded due to cors related issues. No image textures.

I am using it currently for testing this commit:
https://github.com/andreasplesch/x3dom/pull/18

The commit is a bit sensitive since it is affects the setting up of
all routes in a scene, so I want to test it a little bit more
(although I think I understood what is going on well enough) before
submitting (and merging) it to the main repo/master branch.

I find such a test page already useful for this fix, so I do think I
will use it in the future more.

Any feedback or comment much appreciated,

-Andreas

On Wed, Oct 18, 2017 at 1:25 PM, Andreas Plesch <andreasplesch at gmail.com> wrote:
> On Wed, Oct 18, 2017 at 11:34 AM, Don Brutzman <brutzman at nps.edu> wrote:
>> [cc: both lists]
>>
>> Andreas this approach to incremental development and testing looks really
>> great!  Thanks for your efforts in concert with the Fraunhofer team.
>
> Agreed. Incremental experiments could be a more sustainable path
> forward. Divide et impera.
>
>> At some point we might further want to hook up a unit-test suite of X3D
>> scenes to this BuildPR process (perhaps with requested frequency not to
>> exceed once or twice per day updates).
>
> Quite a few things will need to be figured out. But for starters,
> simply having an additional x3dom test version of an (all) example
> which uses
>
> <script type="text/javascript"
> src="http://x3dom-builds.surge.sh/latest/x3dom-full.js"/>
>
> instead of
>
> <script type="text/javascript"
> src="http://www.x3dom.org/download/dev/x3dom-full.js"/>
>
> could be really helpful. Perhaps 'latest' should really become 'testing' .
>
> The URL does not change, and x3dom-full.js is available immediately
> after building from the URL. This would be a way to manually, but
> quickly check a few examples which may be impacted by a change in a
> build.
> So this would not require daily updates of the examples. It does
> require generating a fair number of additinoal xhtml files.
>
> There are probably better ways to get started but this could be done
> quickly perhaps.
>
> I do something similar currently with user scripts and tampermonkey
> which feels clumsy.
>
>>
>> Wondering please, will there be someplace in the X3DOM developers
>> documentation where your information below will be found?
>
> Although this may be premature, I have added a page to the github x3dom wiki:
>
> https://github.com/x3dom/x3dom/wiki/Automatic-PR-builds
>
> and linked to it from the wiki home page.
>
> -Andreas
>>
>> On 10/17/2017 6:21 AM, Andreas Plesch wrote:
>>>
>>> I just posted below on the x3dom-developer list but it may be
>>> interesting here as well. Longer term it may become possible to use
>>> the example archive for automatic testing of x3dom in addition to
>>> automatic building.
>>>
>>> Using github it is convenient to fork x3dom and then use the online
>>> editor to work on the code. To test and use the new code, it is
>>> preferable to build the x3dom.js distribution with the manage.py build
>>> script. This step is sometimes a hurdle because it requires cloning to
>>> a local computer, setting up Python, invoking the script and uploading
>>> the results. Before submitting a pull request to the main master
>>> branch, it is also necessary to test the new code, preferably by
>>> building a new x3dom.js .
>>>
>>> To help with the building step, I am setting up a special BuildPR
>>> branch on my github X3DOM branch
>>> (https://github.com/andreasplesch/x3dom/tree/BuildPR). The BuildPR
>>> branch is synced with the main master branch and triggers automatic
>>> building of x3dom whenever a PR is received against it. This is all
>>> done on the travis ci service. The build is then deployed to
>>> x3dom-builds.surge.sh/latest and x3dom-builds.surge.sh/build_x . The
>>> 10 most recent builds are kept under build_0 to build_9.
>>> x3dom-builds.surge.sh provides a listing of all builds.
>>>
>>> This mostly works but Travis sometimes just stops the build process.
>>> Possibly, the build script is overwhelming the logging facility.
>>> Investigating. May try redirecting output to a file or /dev/null.
>>>
>>> I may separate out the latest, most recently requested build to its
>>> own domain: x3dom-testing.surge.sh . This would be easy to do.
>>>
>>> It would be useful to try this build service by just retargeting
>>> existing PRs from the main master branch to the andreasplesch/BuildPR
>>> branch. travis and/or github may behave differently when dealing with
>>> PRs from forks other than the owner's. Any feedback and ideas for
>>> improvement are welcome,
>>>
>>> Andreas
>>>
>>> PS: it is possible to submit a PR which modifies the build script and
>>> thereby allows uploading of arbitrary content. So you can only really
>>> trust the build results of your own PRs. Using other builds or other
>>> files served from this domain requires the level of trust you would
>>> have when using information from an unknown web site.
>>
>>
>> all the best, Don
>> --
>> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
>> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
>> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
>
>
>
> --
> Andreas Plesch
> Waltham, MA 02453



-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list