Monday, September 11, 2006

YATSY: Yet Another Test Server - Yaws compatible

Yatsy is a simple test framework for testing your Erlang code. It makes it possible to execute test suites according to a defined structure and format, presenting the result either dynamically (via Yaws) or by generated HTML files.

A testcase is implemented by a function that you write. You collect a number of such testcases in an Erlang module which ends in: _SUITE.erl. You may have any number of such test suite modules which you compile to beam files located in your ebin directories.

You start your system, add the code paths to Yatsy and Yaws and start Yatsy. Yatsy will now automatically find all test suite modules that exist as beam files in you code path. Next you order Yatsy to run your test cases, which it will do suite by suite. The result will be accessible by pointing a Web browser to: http://localhost:8888/yatsy.yaws .

Yatsy is under development, but it is already possible to run test cases locally or on a remote Erlang node, to have HTML pages to be generated on disk or simply ask Yaws to provide them.

The intelligent reader may now spot the similarities with the Erlang/OTP Test Server, and indeed Yatsy has taken the main ideas from it. The main difference is the close connection to Yaws but more importantly: Yatsy lives on http://code.google.com/p/yatsy and can therfore be managed in a common Open Source model.

More news about Yatsy will be posted here in the future.

Thursday, September 07, 2006

A new Yaws appmod: ymnesia

I have added a (IMHO) very useful appmod to the Yaws CVS.

ymnesia.erl makes it easy to browse and search in your
Mnesia tables.

To set it up, add it as an appmod:

appmods = [{"showdb", ymnesia}],


Then point your browser to:

http://<host>/showdb/


You will see a table with all your Mnesia tables
and their fields. You can now perform searches
and view only certain fields if you so whish.

Wednesday, September 06, 2006

Starting Yaws in embedded mode

I have comitted some new functions to make it really
easy to start Yaws in embedded mode from your own
system. This way, it is not necessary to specify any
-yaws switch to the Erlang start script or to include
the yaws.hrl file to access the sconf/gconf records of Yaws.


The minimal information you need to specify is the 'DocRoot',
i.e the location where your .html and .yaws files lives.
All other configuration parameters will get the same default
values as defined in yaws.hrl.


It is also possible to override any of the parameter in the
sconf/gconf records if you so wish. See examples of the three
ways of invoking the new functions yaws:start_embedded/1,2,3 below:


DocRoot = "/home/tobbe/docroot",
GL=[{trace,false},{tmpdir,local_path(["priv", "tmp"]),
{flags,[{auth_log,false},{copy_errlog,false}]}],
SL=[{port,Port},{appmods,AppMods},
{flags,[{access_log,false}]}],

yaws:start_embedded(DocRoot). % alternative 1.

yaws:start_embedded{DocRoot, SL). % alternative 2.

yaws:start_embedded{DocRoot, SL, GL). % alternative 3.

Sunday, November 27, 2005

wblog and RSS

I have added RSS support to wblog (part of the yfront package).

A new erlmerge package, with example code, has been uploaded to trapexit.org.


Saturday, November 19, 2005

Yfront - A Yaws toolbox

I have started a new project in Jungerl named Yfront.

The intention is to create a toolbox of building blocks for building
web applications. Especially the combination of Yaws and Mnesia
is an intresting area. Initially, Yfront contains three modules:
wblog, wraplog and ymnesia.

wblog is a Yaws/Mnesia plugin that implements a blog.
wraplog is a simple but effective wraplog
ymnesia is a Yaws appmod for inspecting Mnesia tables.

The documentation can be found here.

To install Yfront, use erlmerge as in: erlmerge -i yfront

Thursday, November 10, 2005

EUC-2005

So, the 11:th EUC has been executed.

As usual it was great fun to meet old and new Erlang friends. The things I liked the most was the proposed extension of the binary syntax and the upcoming multi-processor Erlang. It was also very nice to hear the Erlang is spreading in Sout-America . Unfortunately, I couldn't attend the beer drinking at the ErlLounge afterwards. Hopefully, I'll be able to make it next year.


Sunday, November 06, 2005

Yaws and Mnesia

I wrote a Yaws appmod the other day that is quite useful if you are using Mnesia and Yaws. It can be downloaded here.

Just put in your path, configure it as an appmod in your yaws.conf and point your browser to your server with ymnesia in the path.

You will be presented with a table containing all your Mnesia tables and their fields, where you can search on arbitrary Erlang terms (nb: atoms need to be single-quoted).