Testing

From semantic-mediawiki.org

Tonis solutions uses travis to test see

Since this only test that the setup script does not fail I wanted something more. I ended up creating a "testinstall" script which is referenced in https://github.com/BITPlan/ProfiWiki/blob/master/.travis.yml

https://github.com/BITPlan/ProfiWiki/blob/master/testinstall The tricky part was the waiting for docker to "do it's thing". Currently i am using timeouts which is unfortunately much dependend on the hardware. Here are some lines as an example:

  timestamp
  color_msg $blue "started install with pid $install_pid log is shown with pid $tail_pid"
  waitif "Pulling from library/mediawiki" "Waiting until docker pull is finished" "Step 2/" "Docker download cached" nohup.out 0.2 25 1000
  timestamp
  # if docker has not cached the results yet wait
  waitif "Reading package lists..." "Waiting until docker build is finished" "Step 6/" "Docker build cached" nohup.out 0.2 25 1000
  timestamp
  # wait for e.g. chown to finish
  waitfor "Step 7/" nohup.out 0.2 1000
  # check that the Apache 2 Webserver is up
  # 30 times 0.2 secs = 6 secs timeout
  waitfor "apache2 -D FOREGROUND" nohup.out 0.2 30
  timestamp
  # check that the MariaDB is up
  # 50 times 0.2 secs = 10 secs timeout
waitfor "port: 3306" nohup.out 0.2 50

What would be a better way to test?

17:24, 11 January 2019