Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

add support to copy and search the server log file for errors - #35

Merged
PVince81 merged 3 commits into
masterfrom
server-log-scrape
Mar 24, 2015
Merged

PVince81 merged 3 commits into
masterfrom
server-log-scrape

Conversation

@jnfrmarks

Copy link
Copy Markdown

Not the cleanest approach but it gets us the needed files

@PVince81 @SergioBertolinSG @jvillafanez for review

@PVince81

Copy link
Copy Markdown

You might want to try adding this directly to the smashbox framework instead of requiring every test to add an additional step.

@jnfrmarks

Copy link
Copy Markdown
Author

Actually, I agree. Where in the framework/test execution do you recommend this goes?

@jvillafanez

Copy link
Copy Markdown
Member

I think the ideal and standard approach should be:

  1. Setup test
  2. Spawn workers
  3. Tear down test when workers finish

It should be also possible to add a global setup for all the tests, and a global tear down.

This is what other frameworks offer. I don't know if there is support to do this or we need to add it

@jnfrmarks

Copy link
Copy Markdown
Author

I never thought to put it in the smash file ;) Let me look at that. I could even make it an argument with a default of True

Comment thread python/smashbox/utilities/oc_utils.py Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this to from smashbox.utilities import runcmd seems to make it import "runcmd", but then "runcmd" for some reason cannot find the global logger...

Also it seems that the global logger is not available in this module, even though it's available in init during a test run. Maybe the multi processing engine normally creates the logger instance somehow...

I still don't understand it. It's too convoluted.

@PVince81

Copy link
Copy Markdown

I think one clue is that normally all functions inside "utilities" are usually called from inside the multiprocessing engine, which itself defines the global "logger" instance.

But in your case, it's outside. It's another logger, and it's not global, only defined in the scope of "main()": https://github.com/owncloud/smashbox/blob/master/bin/smash#L68

Now need to find a way to make this all work

@jnfrmarks

Copy link
Copy Markdown
Author

I'll see if Kuba can help.

@jnfrmarks

Copy link
Copy Markdown
Author

In chatting with Kuba, he pointed out that each test makes a call to reset_rundir, which will delete the directory needed to hold the owncloud.log file for each test run. I ended up keeping the original approach of making the calls on a per test basis but combined the test setup and teardown methods into one.

@jnfrmarks

Copy link
Copy Markdown
Author

@PVince81 @SergioBertolinSG @jvillafanez for review again

@jnfrmarks

Copy link
Copy Markdown
Author

@PVince81 @jvillafanez @SergioBertolinSG

ping - I'd like to merge this code today.

Thanks!

@jvillafanez

Copy link
Copy Markdown
Member

If we're going to keep that approach, then it's fine.

@PVince81

Copy link
Copy Markdown

👍

PVince81 pushed a commit that referenced this pull request Mar 24, 2015
add support to copy and search the server log file for errors
@PVince81
PVince81 merged commit 3722e6d into master Mar 24, 2015
@PVince81
PVince81 deleted the server-log-scrape branch March 24, 2015 10:25
nickvergessen pushed a commit that referenced this pull request Oct 23, 2015
Fix server scrape log (by owncloud).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants