Error 403

We're sorry, but we could not fulfill your request for /doc/Dev/Testing on this server.

An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.

Your technical support key is: 03f8-04a9-1756-6707

You can use this key to fix this problem yourself.

If you are unable to fix the problem yourself, please contact webmaster at wackowiki.org and be sure to provide the technical support key shown above.

Testing - WackoWiki

Testing


Quality Assurance (QA): Test our release packages. Install them from scratch, try updates from previous versions, make sure everything is working, check if the upgrader works along the different (Repo-)Versions.


The chain breaks at the weakest link.


  1. TodoList
  2. https://wackowiki.org/lab/
  3. Setup a local Test Server

wackowiki-6.2.1.zip (2.9 MiB)


Please download the program, take it for a test-drive and tell us what you think.
BETA versions are always for testing purposes only.

Development version
(see Repository)


Beta version
wackowiki-6.3.0-beta8.zip


Keep in mind, that this is still an alpha version - so be advised to not use it for production data!


¯\_(ツ)_/¯

1. Tools

2. Testing


  1. Test new patches - try them out and see what breaks
  2. Do performance tests - compare versions & settings
  3. Do security audits
  4. Do benchmarks
  5. Do localization checks
  6. Check standards / spec compliance - SQL, XML, APIs, ...
    1. https://developers.google.com/speed/pagespeed/insights/
    2. https://securityheaders.io
    3. HTML validator
    4. CSS validator
    5. Feed validator
    6. https://web.dev/measure
    7. https://search.google.com/test/rich-results
    8. WAVE – Online accessibility validator
    9. http://jshint.com
    10. http://www.webpagetest.org - Test a website's performance
    11. W3C Internationalization Checker
    12. REDbot - lint for HTTP resources; it tests protocol correctness, cacheability, content negotiation and more.
    13. https://regex101.com/ - Online regex tester and debugger

  1. https://github.com/mozilla/readability - test with firefox reading mode
  2. Test integration - does the new version work with all scripts & dbs?

3. Debugging

  1. check error logs
    1. \apache\logs\error.log
    2. \php\logs\php_error_log

3.1. Debug options

3.1.1. Primary config

config/config.php

  1. set sql_mode in primary config to 2 to enable SQL Session Strict mode
     'sql_mode' => '2',	

3.1.2. Secondary config

debug and query caching option
enable the debug option to show all executed SQL queries and disable the query caching option

config table (Admin Panel -> System)

  1. set 'debug' in secondary config to 3
  2. set cache in secondary config to 0
  3. set cache_sql in secondary config to 0

3.1.3. Constants

config/constants.php

  1. set DB_ERROR_MODE in config/constants.php
    const DB_ERROR_MODE	= 1;	
    1. Warning
    2. Exception (Fatal error)
  2. set PHP_ERROR_REPORTING in config/constants.php
    const PHP_ERROR_REPORTING	= 6;	
    1. Fatal error
    2. Parse error
    3. Warning
    4. Notice

3.1.4. JavaScript


Control Debug Mode (in default.js)

// Force production mode (mute debug logs)
window.DEBUG_MODE = false;
 
// Or force debug mode
// window.DEBUG_MODE = true;

3.2. php_error_log

[19-May-2022 11:31:23 Mittelerde/Auenland] PHP Deprecated:  preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/hobbit/git/wackowiki/src/formatter/class/typografica.php on line 134
[19-May-2022 11:31:23 Mittelerde/Auenland] PHP Deprecated:  preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/hobbit/git/wackowiki/src/formatter/class/typografica.php on line 135	

3.2.1. Filter messages

You can easily filter messages sent to error_log() using tail and grep on *nix systems. This makes monitoring debug messages easy to see during development.


Be sure to "tag" your error message with a unique string so you can filter it using grep:


In your code:

error_log("KeyWORD - Param1: $value1 - Param2: $value2");	

On your command line:

tail -f /var/log/httpd/error_log | grep KeyWORD	

In this example, we pipe apache log output to grep (STDIN) which filters it for you only showing messages that contain KeyWORD.


The -f option means "follow" which streams all new log entries to your terminal or to any piped command that follows, in this case grep.

3.3. MySQL/MariaDB log

  • Monitor slow queries with SHOW FULL PROCESSLIST;
  • enable the slow_query_log in MySQL

3.4. Debug functions

  1. to write a parameter in the debug log
    • Ut::dbg('debug_variable', $parameter);
  2. add debug output to DEBUG file and popup-window in browser
    • Diag::dbg($parameter);
    • to highlight the debug output in the console add '[BLUE|GOLD|ORANGE|RED]' as the first argument
      • e.g. Diag::dbg('GOLD', $parameter);
      • Diag::dbg('GOLD', 'Message set:', $lang, $name, @$this->user_lang, @$this->page_lang, @$this->notify_lang);

3.4.1. Example

Diag::dbg('preprocess', $parser->preprocess ? 'true' : 'false');

;
-0.2427	formatter/wacko.php:50	preprocess false
-0.2365	formatter/wacko.php:50	preprocess true
-0.0547	formatter/wacko.php:50	preprocess false
0.0332	formatter/wacko.php:50	preprocess false	

// In some handler or page load, add this test code:
if ($this->db->debug)
{
	// Test basic debug
	Diag::dbg('Test basic debug message');

	// Test with color
	Diag::dbg('GOLD', 'Test gold colored message');
	Diag::dbg('BLUE', 'Test blue message: ' . $this->tag);
	Diag::dbg('ORANGE', ['array_test' => 'value', 'tag' => $this->tag]);
}	

WackoWiki Debug Console

3.4.2. File permissions

In both cases it writes the $parameter to the log in the main directory src/DEBUG when the config debug is enabled.
Be aware the log isn't emptied automatically. Ensure that the file src/DEBUG can be created and is writable.

touch DEBUG
chmod 0664 DEBUG