BUGS that need fixing

clear_first

In …/calculators/webapp/tst/plugin/cobblestones/webMath.py clear_first is True (always using the default). That is wrong, and not allowing 1+2+3

Better to do that is the AST, or brick

(Only) Removing it will break the example-test

BUGS, which are mostly fixed

RekenServer: ImportError: No module named ‘plugin’

No of the ATSes will run, as they can’t import plugin.cobblestones

This depends on the setting of PYTHONPATH. When it contains a empty path (a colon/semicolon on it own), the cwd is on the PYTHONPATH. As that is “tst” dir, the plugin dir is found. Without that (semi)colon, the dir is NOT on the path, so not found, so an error is encountered.

Note: In both cases (tst)ATS is on sys.path (no 0). But that is the wrong dir

Error

>>> ATS/logInUit.py --vector ../../tst/tst-data/sessie.csv --log=WARNING
|Traceback (most recent call last):
|  File "ATS/logInUit.py", line 7, in <module>
|    from plugin.cobblestones import sessie
|ImportError: No module named 'plugin'

Workaround

For now, pathways/__init__.py add the current/tst dir to the path.

pathways/__init__.py
# Copyright (C) ALbert Mietus, SoftwareBeterMaken.nl; 2014, 2015. Part of Pathways project -*- coding: utf-8 -*-
## Runners:
from  .runners.run import autorun


## Vectors:
from  .data.tstVectors import TstVectors

## verify
from .core.verify import verify

###
### HACKS
###

# THIS IS A WORKAROUND, to find the 'plugin' directories (and other local modules also)
import sys
sys.path.append("") # Add the current dir to the search-path

Paths

Due to RestructureExamples several directories can have the same name, like:

  1. examples/calculators/webapp/tst/bricks, and

  2. examples/calculators/tst/bricks.

When both are on the loadpath (PYTHONPATH) only the first is searched for. A module as bricks.add isn’t found when it located in the second “bricks”; even when the first doesn’t have an add module.

Workaround

For now Pathways/examples/calculators/webapp/tst/bricks is moved to Pathways/examples/calculators/webapp/tst/_bricks, as it doesn’t have important code

Todo

Move _bricks back to bricks in Pathways/examples/calculators/webapp/tst/ And solve this issue

Known BUGS

pathways.puts.webput

The selenium driver doesn’t work with pypy3. Firefox is started but remains blank. After some time Firefox disappears …

(PyPy3)$ cd /Users/albert/work/Pathways/examples/calculators/src/webapp/tst
(PyPy3)$ PYTHON=pypy3 make test # or test1
@@ FAILED to run the test, due Message: 'Can\'t load the profile. Profile Dir: /var/folders/......

examples/calculators/webapp/tst/plugin/cobblestones/webMath.py

Function Webmath.__calc() has a clear_first parameter, which is always True. This is considered as a WRONG HACK.

This results in clicking the ‘clear’ button; before each calculation. Which results in correct additions. But that is not how normal people act. Without this (or by setting it for False) the calculation are wrong (as the old value is the start of the next input)

>>> 5 + 7 ==> 12
>>> 1 + 2  ==> 123 # WRONG
The '1' is appended to the string '12', becoming 121. Adding 2 (``+ 2``) results in 123

Temporally code

dev: Generic ATS for all calculators

I’m busy with generic ATS scripts for calculator/webapp and calculator/server. It’s kind of hard. And there are all kind of environmental relations. Sometimes selenium wil not start/run/load, (see below). And hardcoded paths, techno dependencies, ect.

So a lot of (temporally) changes and files are added

EXTRA files

A few extra (failing) test:

| examples/calculators/tryout/server.combi_g.sh
| examples/calculators/tryout/webapp.telop_g.sh
| examples/calculators/tryout/_shared.sh  *support*

These following ‘_g’ files are modifications of the normal files:

| examples/calculators/src/webapp/tst/ATS/telop_g.py
| examples/calculators/src/server/tst/ATS/combi_g.py

Running the extra tests

The output is shortened

  (Python3)$ (cd examples/calculators/src/server; ../rekenServer.py &) # run the server
  (Python3)$ cd examples/calculators/tryout

  # DEBUG=yes in env (pre prepend) will add debug-logging

  (Python3)$./webapp.telop_g.sh
  ## 2015-01-10 00:08:17,323 ERROR                xmlrpcPut::xml_call                # The rekenserver does not support widget; details: <Fault 1: '<class \'Exception\'>:method "widget" is not supported'>
  @@ FAILED to run the test, due a TstException: ('The rekenserver does not support %s; details: %s', 'widget', <Fault 1: '<class \'Exception\'>:method "widget" is not supported'>)
  [ ...  the webapp is OK ... ]
  === All test are run OK

  (Python3)$ ./server.combi_g.sh
  Testing SRV: --gate=/Users/albert/work/Pathways/examples/calculators/src/server/tst:gate.rekenMachine:RekenServer --put=http://localhost:37421
  === All test are run OK
  Testing APP: --gate=/Users/albert/work/Pathways/examples/calculators/src/webapp/tst:gate.rekenApp:RekenApp --put=file:///Users/albert/work/Pathways/examples/calculators/src/webapp/js_calc.html
 ## 2015-01-10 00:05:19,159 WARNING                 sessie::_loginout_check          # LOGIN/OUT FAILED (on message): expect=('True', 'Welcome *'), got=(True, '0'); found=
 @@ One or more tests FAILED