view · edit · sidebar · attach · print · history

20110927-testcases-migel-photo-ebps

<< | Index | >>


  1. 'Photos' should be used instead of 'Foto' in French version
  2. Remove 'Foto' section if there is no monid
  3. Create 6 more scripts and yml setting files with photo
  4. Testcases migel
  5. Setup migel server

Goal/Estimate/Evaluation:

  • update ebook / 100% / 100%
  • testcase migel / 100% / 100%
  • setup migel server / 100% / 100%
Milestones
  1. Update photos ebps
  2. Prepare all scripts ebps
  3. Testcases migel, oddb.org
Commit
ToDo
  1. Do not show Foto title if there is no monid in ebook
  2. Fix the latest kindlegen error

'Photos' should be used instead of 'Foto' in French version

Experiment

  • lib/ebps/conversion/fachinfo_xml.rb
    @current_chapter.heading << (EBPS.config.language == 'de' ? 'Fotos' : 'Photos')

Run

masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_de_firefox config="etc/emediat_de_firefox.yml"
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_fr_firefox config="etc/emediat_fr_firefox.yml"

Result

  • Good
  • German -> 'Fotos'
  • French -> 'Photos'

Remove 'Foto' section if there is no monid

Note

  • It seems that every monid tag has a number in a xml file
  • But there is no directory corresponding to the number

Experiment

  • lib/ebps/config.rb
module EBPS
  defaults = {
...
    'photos'            => '',
...
  • etc/emediat_de_firefox.yml
#photos: /home/masa/ywesee/ebps/Components

Run

masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/emediat_de_firefox config="etc/emediat_de_firefox.yml" 

Result

  • Good
  • I have confirmed no photos section in an ebook

Create 6 more scripts and yml setting files with photo

Task

  • Prepare 6 more scripts in /var/ebps
    1. emediat_de_firefox_photo
    2. emediat_de_stanza_photo
    3. emediat_de_kindle_photo
    4. emediat_fr_firefox_photo
    5. emediat_fr_stanza_photo
    6. emediat_fr_kindle_photo
  • 6 more yaml files in /etc/ebps
    1. emediat_de_firefox_photo.yml
    2. emediat_de_stanza_photo.yml
    3. emediat_de_kindle_photo.yml
    4. emediat_fr_firefox_photo.yml
    5. emediat_fr_stanza_photo.yml
    6. emediat_fr_kindle_photo.yml

Result

  • Done

Commit

Note (in order to activate the new scripts)

  • git pull on the server Done (/usr/local/share/src/ebps)
  • update run_emediat_ebooks Done
  • (I do not have to change cron job)
  • ebooks both with and without photos (total 6 emediat ebooks) will come on the 1st of October

Testcases migel (oddb.org)

  • test/test_state/migel/items.rb (Coverage: 100%)
  • test/test_view/migel/items.rb (Coverage: 100%)
  • test/test_view/migel/result.rb (Coverage: 100%)
  • test/test_view/migel/product.rb (Coverage: 100%)
  • test/test_state/global.rb (Coverage: 99.75%)
  • test/test_util/oddbapp.rb (Coverage: 87.79%)
  • test/test_model/migel_items.rb (Coverage: 100%)

Total coverage: 94.65%

Setup migel server

ToDo

  1. Set up migel server
    1. create database (PostgreSQL)
    2. undump sql
    3. create a new git repositoy for migel
    4. git clone on server
    5. set up a yaml config file
    6. (confirm bin/admin)
    7. daemontools script for migeld
  2. Set up oddb.org for migel server
    1. git commit
    2. git pull
    3. restart oddb.org
    4. (Confirm migel view)
  3. Cron job
    1. job script
    2. update crontab

Experiment (create table test locally)

  • backup database
masa@masa ~/ywesee/migel_dev $ pg_dump -u postgres migel > migel_db.20110927.sql
  • replace an user in the sql , from 'postgres' to 'migel'
masa@masa ~/ywesee/migel_dev $ vim migel_db.20110927.sql
:%s/postgres/migel/g
  • create a new user

masa@masa ~/ywesee/migel_dev $ createuser migel
Soll die neue Rolle ein Superuser sein? (j/n) n
Soll die neue Rolle Datenbanken erzeugen dürfen? (j/n) f
Soll die neue Rolle weitere neue Rollen erzeugen dürfen? (j/n) n

masa@masa ~/ywesee/migel_dev $ psql -U postgres
psql (8.4.2)
Geben Sie »help« für Hilfe ein.

postgres=# select * from pg_user;
 usename  | usesysid  | usecreatedb | usesuper | usecatupd |  passwd  | valuntil | useconfig 
----------+-----------+-------------+----------+-----------+----------+----------+-----------
 postgres |        10 | t           | t        | t         | ******** |          | 
 migel    | 833881636 | t           | f        | f         | ******** |          | 

masa@masa ~/ywesee/migel_dev $ sudo -u postgres createdb -U migel -E UTF8 -T template0 migel
masa@masa ~/ywesee/migel_dev $ psql -U postgres
psql (8.4.2)
Geben Sie »help« für Hilfe ein.

postgres=# \l
                                      Liste der Datenbanken
        Name        | Eigentümer | Kodierung | Sortierfolge | Zeichentyp |    Zugriffsrechte     
--------------------+-------------+-----------+--------------+------------+-----------------------
 migel              | migel       | UTF8      | C            | C          | 
 oddb               | postgres    | UTF8      | C            | C          | 

  • drop and create a new database (by migel user)
masa@masa ~/ywesee/migel_dev $ sudo -u postgres dropdb migel
masa@masa ~/ywesee/migel_dev $ sudo -u postgres createdb -U migel -E UTF8 -T template0 migel
masa@masa ~/ywesee/migel_dev $ cat migel_db.20110927.sql | psql -U migel migel
  • Change db_user in yaml file
masa@masa ~/ywesee/migel_dev $ cat etc/migel.yml 
---
#db_user: 'postgres'
db_user: 'migel'
db_auth: ''
...

Create user and database on server

Log

$ psql -U postgres
Welcome to psql 8.3.8, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

postgres=# select * from pg_user;
    usename     | usesysid | usecreatedb | usesuper | usecatupd |  passwd  | valuntil | useconfig 
----------------+----------+-------------+----------+-----------+----------+----------+-----------
...
(10 rows)

postgres=# \q

$ su
# su postgres
$ createuser migel
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n

postgres@thinpower /home/ywesee $ createdb -U migel -E UTF8 -T template0 migel
postgres@thinpower /home/ywesee $ psql -U postgres
Welcome to psql 8.3.8, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

postgres=# \l
               List of databases
        Name        |     Owner     | Encoding  
--------------------+---------------+-----------
...
 migel              | migel         | UTF8
...
(15 rows)
postgres=# \q

(logout)

$ scp migel_db.20110927.sql.bz2 (server)

(login)

$ su
# su postgres
$ bzcat migel_db.20110927.sql.bz2 |psql -U migel migel

git clone on server

Log

(login)
$ cd git
$ tar jxvf migel.tbz
$ cd migel
$ git init
$ git add .
$ git commit -m "Initial commit"

Commit

set up migel server

Log

(cd application directory)
$ su
# git clone git://scm.ywesee.com/migel
# chown -R ywesee migel
# chgrp -R users migel
  • upload migel.yml to etc directory

Confirm bin/admin

Log

$ bin/migeld 
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- oddb/util/m10l_document (LoadError)
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /var/www/migel/lib/migel/model_super.rb:194
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /var/www/migel/lib/migel/model.rb:5
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from bin/migeld:10
$ ruby -I /home/ywesee/git/ch.oddb.org/lib bin/migeld
$ bin/admin
migel> Migel::Model::Migelid.search_by_migel_code('15.30.50.00.1')[0].name
-> Pessaire jetable

Note

  • migeld Error
  • bin/admin works
  • The following works
 $ ruby -I /home/ywesee/git/ch.oddb.org/lib bin/migeld

Note

  • I should fix the error suspend

Commit

Note

Conformation

view · edit · sidebar · attach · print · history
Page last modified on October 07, 2011, at 10:22 AM