Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allmodules unit test confusion #96

Open
aaaaalbert opened this issue Oct 2, 2015 · 1 comment
Open

allmodules unit test confusion #96

aaaaalbert opened this issue Oct 2, 2015 · 1 comment

Comments

@aaaaalbert
Copy link
Contributor

@Ashmita89 reports that on her Windows Vista machine, ut_seash_allmodules.py raises an exception when run as a standalone Python program, but still passes when run under utf.py despite no #pragma error declaration.

Shell transcript:

C:\Users\Ashmita\seash\RUNNABLE>python ut_seash_allmodules.py
- You can see available seash factoids using 'show factoids [number of factoids]
/all' command.

Enabled modules: factoids, geoip, modules, uploaddir, variables

Traceback (most recent call last):
  File "ut_seash_allmodules.py", line 26, in <module>
    seash.command_loop(commands)
  File "C:\Users\Ashmita\seash\RUNNABLE\seash.py", line 192, in command_loop
    seash_dictionary.command_dispatch(cmd_input, environment_dict)
  File "C:\Users\Ashmita\seash\RUNNABLE\seash_dictionary.py", line 2109, in comm
and_dispatch
    current_callback(input_dict.copy(), environment_dict)
  File "C:\Users\Ashmita\seash\RUNNABLE\modules\modules\command_callbacks.py", l
ine 89, in enable_module
    seash_modules.enable(seash_dictionary.seashcommanddict, modulename)
  File "C:\Users\Ashmita\seash\RUNNABLE\seash_modules.py", line 365, in enable
    raise seash_exceptions.UserError("Module is already enabled.")
seash_exceptions.UserError: Module is already enabled.


C:\Users\Ashmita\seash\RUNNABLE>python utf.py -f  ut_seash_allmodules.py
Testing module: seash
Now starting subprocess: ut_seash_subprocess.py
Generating user keys...
Generating owner key...
Writing config file...
Writing vessel dictionary...
Now running setup script: ut_seash_setup.py
        Running: ut_seash_setup.py                                  [ PASS ]
        Running: ut_seash_allmodules.py                             [ PASS ]
@aaaaalbert
Copy link
Contributor Author

OK, here's part of the key to the solution: allmodules is a stateful test (cf SeattleTestbed/utf#66), i.e. after it ran, it leaves traces that change how subsequent runs will behave. In this specific case, see the modules dir, where allmodules happens to cause the creation of *.disabled files: https://github.com/SeattleTestbed/seash/blob/master/tests/ut_seash_allmodules.py#L21-L23 .

@Ashmita89, can you take it from here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant