Skip to content

Install Test System En

Nishimura edited this page Jan 6, 2014 · 1 revision

Install Test System

Below is how to install the test system checking each service regularly. This system call all services on multilingual studio and verify whether each service works correctly or not.

We assume that you can use php on your server. And we test on php ver 5.3.17.

Install phpunit

This system need phpunit, so we must install phpunit with pear. You can install phpunit with below command.

pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit

We need also YAML package, so install it.

pear install symfony/YAML
pear channel-discover pear.symfony-project.com

Then you can run phpunit.

MySQL

Do settings about MySQL. At first, make user with username "mlstudio@localhost" and password "mlstudio". Then, make database with database name "mlstudio" It is all of setting.

Setting of Language Grid account

Please enter your Language Grid ID and Password by editing /langrid-php-library/test_settings.php.

Edit task.sh

You can find "task.sh" in /langrid-php-library/test. This system do regular test by calling this file with cron.

Default directory of "task.sh" is below.

/srv/langrid-php-library/test/

If you want to change the directory, please edit "task.sh".

You can get result of test by e-mail if you add your mail address to "task.sh".

Setting of cron

You need to do setting of cron for regular test. Please change current directory "/langrid-php-library/test" and do below setting.

langriduser@langrid:/srv/langrid-php-library/test> crontab -e
10 1 * * * cd /srv/langrid-php-library/test/ && /bin/sh task.sh

Result of test

Below is sample of test. You can find errors of each service in first part of e-mail. In second half, there are summary of test. You can find check mark in left side of test name which works correctly.

PHPUnit 3.7.9 by Sebastian Bergmann.

...............................................................  63 / 169 ( 37%)
............................................................... 126 / 169 ( 74%)
...........................F..EII......FIF.

Time: 05:49:12, Memory: 16.50Mb

There was 1 error:

1) KyotoLangridResourceTest::testDependencyParserResource with data set "kyoto1.langrid:MaltParser"     ('http://langrid.org/service_manager/wsdl/kyoto1.langrid:MaltParser', 'en', 'this is test.')
LangridException: jp.go.nict.langrid.service_1_2.InvalidParameterException: morphs: must not be empty 

/srv/langrid-php-library/client/impl/ServiceClientImpl.php:110
/srv/langrid-php-library/client/impl/ServiceClientImpl.php:103
/srv/langrid-php-library/client/impl/DependencyParserClientImpl.php:19
/srv/langrid-php-library/test/resource/KyotoLangridResourceTest.php:86

Caused by
SoapFault: jp.go.nict.langrid.service_1_2.InvalidParameterException: morphs: must not be empty 

/srv/langrid-php-library/client/impl/ServiceClientImpl.php:103
/srv/langrid-php-library/client/impl/DependencyParserClientImpl.php:19
/srv/langrid-php-library/test/resource/KyotoLangridResourceTest.php:86

--


There were 3 failures:

1) Warning
No tests found in suite "KyotoLangridResourceTest::testConceptDictionaryResource".


2) Warning
The data provider specified for KyotoLangridResourceTest::testTranslationWithInternalDictionaryResource     is invalid.
undefined index when service resource test


3) Warning
The data provider specified for KyotoLangridResourceTest::testDictionaryResource is invalid.
undefined index when service resource test


FAILURES!
Tests: 169, Assertions: 244, Failures: 3, Errors: 1, Incomplete: 3.

DictionaryContent
 [x] Hoge
 [x] Validate presense dictionary record id
 [x] Validate presense language
 [x] Validate presense text
 [x] Validate unique language
 [x] Update with attribute
 [x] Update with attributes
 [x] Update with save
 [x] testFind all by dictionary id
 [x] testDelete all by resource id and language

DictionaryDeployment
 [x] Validate presense dictionary id
 [x] Validate unique dictionary id

DictionaryLanguage
 [x] Validate presense language
 [x] Validate unique language

DictionaryRecord
 [x] Validate presense dictionary id
 [x] testGet contents
 [x] testCount by resource id each languages
 [x] testGet contentsWithProperty
 [x] testCount by dictionary id and language
 [x] testGet contents as ordered array1
 [x] testGet contents as ordered array2
 [x] testUpdate contents basic
 [x] testUpdate contents append
 [x] testUpdate contents basic with user
 [x] testUpdate contents append with user
 [x] Create error
 [x] Cascade delete

Dictionary
 [x] Find
 [x] Find with deleted
 [x] All
 [x] All with deleted
 [x] Create
 [x] Update 1
 [x] Update 2
 [x] Update 3
 [x] Find include
 [x] Remove
 [x] testAll without delete flag on
 [x] Remove force
 [x] Remove force count all
 [x] testAdd language
 [x] testAdd language validate unique
 [x] testGet languages
 [x] testRmove language
 [x] testUpdate language validate minimum
 [x] testUpdate language
 [x] testUpdate language force
 [x] testRmove language force
 [x] testAdd record
 [x] testIs deploy
 [x] testIs not deploy
 [x] Deploy
 [x] Undeploy
 [x] testCount records each language
 [x] testCount records by language
 [x] testRecords count
 [x] testGet records
 [x] testCan view any
 [x] testCan view only user
 [x] testCan edit any
 [x] testCan edit only user
 [x] testIs owner
 [x] testCreate with records
 [x] testTransation create with records language
 [x] testTransation create with records unidentified language
 [x] testTransation create with records count record

ParallelTextContent
 [x] Hoge
 [x] Validate presense parallel text record id
 [x] Validate presense language
 [x] Validate presense text
 [x] Validate unique language
 [x] Update with attribute
 [x] Update with attributes
 [x] Update with save
 [x] testFind all by resource id
 [x] testDelete all by resource id and language

ParallelTextDeployment
 [x] Validate presense parallel text id
 [x] Validate unique parallel text id

ParallelTextLanguage
 [x] Validate presense language

ParallelTextRecord
 [x] Validate presense parallel text id
 [x] testGet contents
 [x] testCount by parallel text id each languages
 [x] testGet contentsWithProperty
 [x] testCount by parallel text id and language
 [x] testGet contents as ordered array1
 [x] testGet contents as ordered array2
 [x] testUpdate contents basic
 [x] testUpdate contents append
 [x] testUpdate contents basic with user
 [x] testUpdate contents append with user
 [x] Create error
 [x] Cascade delete

ParallelText
 [x] Find
 [x] Find with deleted
 [x] All
 [x] All with deleted
 [x] Create
 [x] Update 1
 [x] Update 2
 [x] Update 3
 [x] Find include
 [x] Remove
 [x] testAll without delete flag on
 [x] Remove force
 [x] Remove force count all
 [x] testAdd language
 [x] testAdd language validate unique
 [x] testGet languages
 [x] testRmove language
 [x] testUpdate language validate minimum
 [x] testUpdate language
 [x] testUpdate language force
 [x] testRemove language force
 [x] testAdd record
 [x] testIs deploy
 [x] testIs not deploy
 [x] Deploy
 [x] Undeploy
 [x] testCount records each language
 [x] testCount records by language
 [x] testRecords count
 [x] testGet records
 [x] testCan view any
 [x] testCan view only user
 [x] testCan edit any
 [x] testCan edit only user
 [x] testIs owner
 [x] testCreate with records
 [x] testTransation create with records language
 [x] testTransation create with records unidentified language
 [x] testTransation create with records count record

DictionaryLegacyBridge
 [x] Get permission
 [x] Do create
 [x] Do download
 [x] Get all dictionaries by type id
 [x] Get all dictionaries by type id with offset limit
 [x] Count all dictionary contents by dictionary id
 [x] Get all dictionary contents by dictionary id
 [x] Get all dictionary contents by dictionary id offset limit
 [x] Can delete
 [x] Remove dictionary
 [x] Do update

KyotoLangridResource
 [x] Parallel text resource
 [x] Morphological analysis resource

PHPUnit_Framework_Warning
 [ ] Warning

KyotoLangridResource
 [x] Bilingual dictionary resource
 [x] Bilingual dictionary with longest match search resource
 [ ] Dependency parser resource
 [ ] Keyphrase extraction resource
 [ ] Language identification resource
 [x] Similarity calculation resource
 [x] Speech recognition resource
 [x] Template parallel text resource
 [x] Text to speech resource
 [x] Translation resource
 [x] Adjacency pair resource

PHPUnit_Framework_Warning
 [ ] Warning

KyotoLangridResource
 [ ] Translation selection resource

PHPUnit_Framework_Warning
 [ ] Warning

KyotoLangridResource
 [x] Pictogram dictionary resource