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

Adds in memory log storage, to be used while testing. #2858

Merged
merged 3 commits into from
Apr 24, 2018
Merged

Conversation

damencho
Copy link
Member

Enabling it only when config.debug is set, a configuration provided by jitsi-meet-torture.

Enabling it only when config.debug is set, a configuration provided by jitsi-meet-torture.
@bbaldino
Copy link
Member

just curious, what is this useful for?

@damencho
Copy link
Member Author

To get the console logs on test failures. Currently using the grid with chrome we have half of the logs, not sure why. So if the code is console.log("message", object), we get only "message". And all our logs are like that because of the Logger. And for Firefox, we got none as the remote logs retrieval is not implemented yet.

@paweldomas
Copy link
Member

I don't think it's "because of the Logger". It's just that the selenium driver only cares about the 1st argument.

@@ -121,6 +134,7 @@ function _libWillInit({ getState }, next, action) {
function _setLoggingConfig({ getState }, next, action) {
const result = next(action);
const newValue = getState()['features/base/logging'].config;
const isDebugEnabled = getState()['features/base/config'].debug;
Copy link
Member

Choose a reason for hiding this comment

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

would you mind using 'testing.testMode' instead of 'debug' ? I know torture was using 'debug' for some time already, but there's this dedicated 'testing' section in the config now.

@paweldomas
Copy link
Member

Other than the config property it LGTM.

If not the fact that Selenium does not support logs on FF I would probably prefer to concat all console.info arguments into string in an extra 'console' layer. Also I don't like that we are adding yet another usage of global APP variable, but I don't have any better idea at this point how to expose data to torture.

@@ -82,6 +87,16 @@ function _initLogging(loggingConfig) {
Logger.addGlobalTransport(APP.logCollector);
JitsiMeetJS.addGlobalLogTransport(APP.logCollector);
}

if (isTestingEnabled) {
Copy link
Member

Choose a reason for hiding this comment

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

This section should be brought into the if above. It should not execute on mobile currently. There's no such thing as global "APP" there.

/**
* Called by the <tt>LogCollector</tt> to store a series of log lines into
* batch.
* @param {string|object[]}logEntries an array containing strings
Copy link
Member

Choose a reason for hiding this comment

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

missing space between {string|object[]} and logEntries

}

/**
* @return {boolean} <tt>true</tt> when this storage is ready or
Copy link
Member

@paweldomas paweldomas Apr 24, 2018

Choose a reason for hiding this comment

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

hmm there are no lint warnings here ? it would complain that @returns must be used instead of @return

const logEntry = logEntries[i];

if (typeof logEntry === 'object') {
this.logs.push(logEntry.text);
Copy link
Member

Choose a reason for hiding this comment

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

where does logEntry.text come from ?

Copy link
Member

Choose a reason for hiding this comment

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

oh I see it's an aggregated msg

@bbaldino
Copy link
Member

To get the console logs on test failures. Currently using the grid with chrome we have half of the logs, not sure why. So if the code is console.log("message", object), we get only "message". And all our logs are like that because of the Logger. And for Firefox, we got none as the remote logs retrieval is not implemented yet.

Oh interesting, I just ran into the exact same issue on jibri. So does this get you the entire log message from our logger? I still only get the filename basically. The DRIVER logs give a bit more, but the format of them makes them difficult to read. What do the captured logs end up looking like here?

@bbaldino
Copy link
Member

I don't think it's "because of the Logger". It's just that the selenium driver only cares about the 1st argument.

@paweldomas I wonder though if we can do something better in the logger though? console.log statement show up fine in the captured logs, but not our logging statements.

@paweldomas
Copy link
Member

@paweldomas I wonder though if we can do something better in the logger though? console.log
statement show up fine in the captured logs, but not our logging statements.

Hmm that's interesting it's not what I saw. Will have to double check that

@damencho
Copy link
Member Author

Fixing it to show in chrome, will not fix Firefox, which doesn't have it implemented in the driver.

@damencho
Copy link
Member Author

SeleniumHQ/selenium#2910

@paweldomas paweldomas merged commit 8b1aff5 into master Apr 24, 2018
@damencho damencho deleted the debug-logs branch April 27, 2018 20:08
guusdk pushed a commit to guusdk/jitsi-meet that referenced this pull request May 11, 2018
* Adds in memory log storage, to be used while testing.

Enabling it only when config.debug is set, a configuration provided by jitsi-meet-torture.

* Moves to using config.testing.testMode property for logs storage.

* Fixes comments.
ztl8702 pushed a commit to ztl8702/jitsi-meet that referenced this pull request Jun 26, 2018
* Adds in memory log storage, to be used while testing.

Enabling it only when config.debug is set, a configuration provided by jitsi-meet-torture.

* Moves to using config.testing.testMode property for logs storage.

* Fixes comments.
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

Successfully merging this pull request may close these issues.

3 participants