($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Tim Orling <ticotimo@gmail.com>
To: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com>
Cc: bitbake-devel@lists.openembedded.org, toaster@lists.yoctoproject.org
Subject: Re: [Toaster] [PATCH v2] toaster: add tox.ini file to execute test suite
Date: Tue, 24 Oct 2023 14:54:23 -0700	[thread overview]
Message-ID: <CANx9H-ApQ=1R_tStRPftBRf2UE6KSFQ7a5tOSrVMZ2SPDws1cA@mail.gmail.com> (raw)
In-Reply-To: <20231024182828.156237-1-marlon.rodriguez-garcia@savoirfairelinux.com>

[-- Attachment #1: Type: text/plain, Size: 4217 bytes --]

I still see failing tests, but the tox.ini itself is functional enough and
streamlined enough to merge now.

On Tue, Oct 24, 2023 at 11:28 AM Marlon Rodriguez Garcia <
marlon.rodriguez-garcia@savoirfairelinux.com> wrote:

> Updated tox file to fix enviroments variables.
> to run tox use the following command:
> tox -e env_name -c /path/to/file/tox.ini
> See tox cli https://tox.wiki/en/latest/cli_interface.html
> The variable env_name is linked to the python versions (py38, py39, py310).
> If env_name option is not set,  the test suite will run for all indicated
> versions.
>
> It was also modified the webdriver options for chrome to run selenium test
> in console because of the error detected in the previous test run
> selenium.common.exceptions.SessionNotCreatedException: Message: session
> not created: Chrome failed to start: exited normally.
>   (session not created: DevToolsActivePort file doesn't exist)
> (The process started from chrome location /usr/bin/google-chrome is no
> longer running, so ChromeDriver is assuming that Chrome has crashed.)
>
> Signed-off-by: Marlon Rodriguez Garcia <
> marlon.rodriguez-garcia@savoirfairelinux.com>
>
Reviewed-by: Tim Orling <tim.orling@konsulko.com>
Tested-by: Tim Orling <tim.orling@konsulko.com>


The following lines belong below the three hyphens (---) so they do not
show up in the final git history.
If you are using git send-email you can use --annotate to edit the patch
before sending.


> Changes in v2
> - Updated variable path BUILDDIR and EVENTREPLAY_DIR to use enviroment
> value
> - Updated toaster-requirements.txt file path
> - Removed flake8
> - Added webdriver options to chrome
> ---
>  .../tests/browser/selenium_helpers_base.py    |  8 +++++++-
>  lib/toaster/tox.ini                           | 20 +++++++++++++++++++
>  2 files changed, 27 insertions(+), 1 deletion(-)
>  create mode 100644 lib/toaster/tox.ini
>
> diff --git a/lib/toaster/tests/browser/selenium_helpers_base.py
> b/lib/toaster/tests/browser/selenium_helpers_base.py
> index 9a4e27a3..e0ac4376 100644
> --- a/lib/toaster/tests/browser/selenium_helpers_base.py
> +++ b/lib/toaster/tests/browser/selenium_helpers_base.py
> @@ -33,7 +33,13 @@ def create_selenium_driver(cls,browser='chrome'):
>          browser = env_browser
>
>      if browser == 'chrome':
> -        return webdriver.Chrome()
> +        options = webdriver.ChromeOptions()
> +        options.add_argument('headless')
> +        options.add_argument('--disable-infobars')
> +        options.add_argument('--disable-dev-shm-usage')
> +        options.add_argument('--no-sandbox')
> +        options.add_argument('--remote-debugging-port=9222')
> +        return webdriver.Chrome(options=options)
>      elif browser == 'firefox':
>          return webdriver.Firefox()
>      elif browser == 'marionette':
> diff --git a/lib/toaster/tox.ini b/lib/toaster/tox.ini
> new file mode 100644
> index 00000000..8c0fe171
> --- /dev/null
> +++ b/lib/toaster/tox.ini
> @@ -0,0 +1,20 @@
> +[tox]
> +envlist = py38, py39, py310
> +skipsdist = True
> +toxworkdir = {env:TOX_WORKDIR:.tox}
> +passenv = *
> +
> +[testenv]
> +setenv =
> +    DJANGO_SETTINGS_MODULE=toastermain.settings_test
> +    TOASTER_BUILDSERVER=1
> +    BUILDDIR = {env:BUILDDIR}
> +    EVENTREPLAY_DIR = {env:EVENTREPLAY_DIR:BUILDDIR}
> +commands =
> +    python3 {toxinidir}/manage.py test tests.db tests.commands
> tests.builds tests.browser tests.functional tests.views
> +deps =
> +    -r {toxinidir}/../../toaster-requirements.txt
> +    -r {toxinidir}/tests/toaster-tests-requirements.txt
> +
> +[testenv:chrome]
> +commands={[testenv]commands} --splinter-webdriver=chrome
> \ No newline at end of file
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#5887):
> https://lists.yoctoproject.org/g/toaster/message/5887
> Mute This Topic: https://lists.yoctoproject.org/mt/102163592/924729
> Group Owner: toaster+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/toaster/unsub [
> ticotimo@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 5796 bytes --]

      reply	other threads:[~2023-10-24 21:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 18:28 [PATCH v2] toaster: add tox.ini file to execute test suite Marlon Rodriguez Garcia
2023-10-24 21:54 ` Tim Orling [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANx9H-ApQ=1R_tStRPftBRf2UE6KSFQ7a5tOSrVMZ2SPDws1cA@mail.gmail.com' \
    --to=ticotimo@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=marlon.rodriguez-garcia@savoirfairelinux.com \
    --cc=toaster@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).