added docker script of running kivy test cases for travis

This commit is contained in:
cis 2021-06-10 20:44:19 +05:30
parent c9c54029a6
commit 6f6b15bdd3
No known key found for this signature in database
GPG Key ID: 11DC6F36E8B65B24
22 changed files with 272 additions and 21 deletions

4
.gitignore vendored
View File

@ -1,5 +1,5 @@
**pyc **pyc
**dat #**dat
**.DS_Store **.DS_Store
src/build src/build
src/dist src/dist
@ -21,4 +21,4 @@ build
pyan/ pyan/
.buildozer/ .buildozer/
bin/ bin/
src/images/kivy/default_identicon/*.png src/images/kivy/default_identicon/*.png

15
.travis-kivy.yml Normal file
View File

@ -0,0 +1,15 @@
language: python3.7
cache: pip3
dist: bionic
python:
- "3.7"
addons:
apt:
packages:
- build-essential
- libcap-dev
- xvfb
install:
- pip3 install -r kivy-requirements.txt
script:
- xvfb-run python3 -m unittest src/bitmessagekivy/tests/test_create_random_address.py

63
Dockerfile.kivy-travis Normal file
View File

@ -0,0 +1,63 @@
FROM ubuntu:bionic AS pybm-kivy-travis-bionic
ENV DEBIAN_FRONTEND noninteractive
ENV TRAVIS_SKIP_APT_UPDATE 1
RUN apt-get update
RUN apt-get install -yq --no-install-suggests --no-install-recommends \
software-properties-common
RUN dpkg --add-architecture i386
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get -y install sudo
RUN apt-get -y install git
RUN apt-get install -yq --no-install-suggests --no-install-recommends \
# travis xenial bionic
python-setuptools libssl-dev libpq-dev python-prctl python-dev \
python-dev python-virtualenv python-pip virtualenv \
# Code quality
pylint python-pycodestyle python3-pycodestyle pycodestyle python-flake8 \
python3-flake8 flake8 python-pyflakes python3-pyflakes pyflakes pyflakes3 \
curl \
# Wine
python python-pip wget wine-stable winetricks mingw-w64 wine32 wine64 xvfb \
# Buildbot
python3-dev libffi-dev python3-setuptools \
python3-pip \
# python 3.7
python3.7 python3.7-dev \
# .travis.yml
build-essential libcap-dev tor \
language-pack-en
# cleanup
RUN rm -rf /var/lib/apt/lists/*
RUN useradd -m -U builder
RUN echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# travis2bash
RUN wget -O /usr/local/bin/travis2bash.sh https://git.bitmessage.org/Bitmessage/buildbot-scripts/raw/branch/master/travis2bash.sh
RUN chmod +x /usr/local/bin/travis2bash.sh
# copy sources
COPY . /home/builder/src
RUN chown -R builder.builder /home/builder/src
USER builder
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
WORKDIR /home/builder/src
# ENTRYPOINT /usr/local/bin/travis2bash.sh
ENTRYPOINT ["/usr/local/bin/travis2bash.sh", ".travis-kivy.yml"]

View File

@ -29,4 +29,6 @@ six==1.12.0
typed-ast==1.4.0 typed-ast==1.4.0
urllib3==1.25.6 urllib3==1.25.6
wrapt==1.11.2 wrapt==1.11.2
zipp==3.1.0 zipp==3.1.0
xclip
xsel

4
run-kivy-tests-in-docker.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
docker build -t pybm-kivy-travis-bionic -f Dockerfile.kivy-travis .
docker run pybm-kivy-travis-bionic

View File

@ -27,7 +27,7 @@ from kivy.uix.textinput import TextInput
import state import state
import queues import queues
from addresses import decodeAddress from addresses import decodeAddress, addBMIfNotPresent
from bitmessagekivy.baseclass.common import ( from bitmessagekivy.baseclass.common import (
toast, showLimitedCnt toast, showLimitedCnt
) )
@ -110,7 +110,6 @@ class DropDownWidget(BoxLayout):
# state.detailPageType = '' # state.detailPageType = ''
# state.send_draft_mail = None # state.send_draft_mail = None
else: else:
from addresses import addBMIfNotPresent
# toAddress = addBMIfNotPresent(toAddress) # toAddress = addBMIfNotPresent(toAddress)
if (addressVersionNumber > 4) or ( if (addressVersionNumber > 4) or (
addressVersionNumber <= 1): addressVersionNumber <= 1):

View File

@ -0,0 +1,59 @@
[bitmessagesettings]
settingsversion = 0
port = 8444
timeformat = %%c
blackwhitelist = black
startonlogon = false
minimizetotray = false
showtraynotifications = true
startintray = false
socksproxytype = none
sockshostname = localhost
socksport = 9050
socksauthentication = false
socksusername =
sockspassword =
keysencrypted = false
messagesencrypted = false
defaultnoncetrialsperbyte = 1000
defaultpayloadlengthextrabytes = 1000
minimizeonclose = false
replybelow = False
maxdownloadrate = 0
maxuploadrate = 0
stopresendingafterxdays =
stopresendingafterxmonths =
sockslisten = false
userlocale = system
sendoutgoingconnections = True
useidenticons = True
identiconsuffix = qcqQGW6sQtZK
maxacceptablenoncetrialsperbyte = 20000000000
maxacceptablepayloadlengthextrabytes = 20000000000
onionhostname =
onionport = 8444
onionbindip = 127.0.0.1
smtpdeliver =
hidetrayconnectionnotifications = false
ttl = 367200
[BM-2cTpgCn57rYUgqm5BrgmykuV9gK1Ak1THF]
label = test1
enabled = true
decoy = false
noncetrialsperbyte = 1000
payloadlengthextrabytes = 1000
privsigningkey = 5KYCPJ4Vp31UD6k5NWmDKtHhfapW25UJ7V2MjctYxcgL3BpWGA3
privencryptionkey = 5JLER8q2zyj3KDEgGMv682en2SRUkkWWhUrNuqVYfGNNhHJmdkJ
lastpubkeysendtime = 1623160189
[BM-2cVrdzQjCQRqUuET6dc3byVyRTjZcgcJXj]
label = test2
enabled = true
decoy = false
noncetrialsperbyte = 1000
payloadlengthextrabytes = 1000
privsigningkey = 5KhryWvNowFWWA9JRjQnLVStYKwhpKpAG4RtWwzyaQqmK2fTMue
privencryptionkey = 5JKQ9NqX2LRzHBCgyxc1GAL3rDvyDTHPifpL22a6UNN7K6y9BmL
lastpubkeysendtime = 1623160221

View File

@ -0,0 +1,110 @@
[
{
"stream": 1,
"peer": {
"host": "5.45.99.75",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "75.167.159.54",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "95.165.168.168",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "85.180.139.241",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "158.222.217.190",
"port": 8080
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "178.62.12.187",
"port": 8448
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "24.188.198.204",
"port": 8111
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "109.147.204.113",
"port": 1195
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
},
{
"stream": 1,
"peer": {
"host": "178.11.46.221",
"port": 8444
},
"info": {
"lastseen": 1620741290.255359,
"rating": 0,
"self": false
}
}
]

Binary file not shown.

View File

@ -1 +1 @@
18675 16342

View File

@ -36,7 +36,7 @@ def set_temp_data():
class TeleniumTestProcess(TeleniumTestCase): class TeleniumTestProcess(TeleniumTestCase):
"""Setting Screen Functionality Testing""" """Setting Screen Functionality Testing"""
cmd_entrypoint = [os.path.join(os.path.abspath(os.getcwd()), 'main_test.py')] cmd_entrypoint = [os.path.join(os.path.abspath(os.getcwd()), 'src', 'main_test.py')]
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):

View File

@ -1,5 +1,4 @@
from .telenium_process import TeleniumTestProcess
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess
from .common import ordered from .common import ordered
data = [ data = [

View File

@ -1,4 +1,4 @@
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
from .common import ordered from .common import ordered

View File

@ -1,7 +1,7 @@
import os import os
import tempfile import tempfile
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess, cleanup from .telenium_process import TeleniumTestProcess, cleanup
from .common import ordered from .common import ordered
from random import choice from random import choice
from string import ascii_lowercase from string import ascii_lowercase

View File

@ -1,4 +1,4 @@
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
from .common import ordered from .common import ordered

View File

@ -1,4 +1,4 @@
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
from .common import ordered from .common import ordered
data = [ data = [

View File

@ -1,4 +1,4 @@
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
class NetwrokStatusScreen(TeleniumTestProcess): class NetwrokStatusScreen(TeleniumTestProcess):

View File

@ -1,4 +1,4 @@
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
class PaymentScreen(TeleniumTestProcess): class PaymentScreen(TeleniumTestProcess):

View File

@ -1,4 +1,4 @@
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
from .common import ordered from .common import ordered
data = [ data = [

View File

@ -1,4 +1,4 @@
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
class SettingScreen(TeleniumTestProcess): class SettingScreen(TeleniumTestProcess):

View File

@ -1,4 +1,4 @@
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
class TrashMessage(TeleniumTestProcess): class TrashMessage(TeleniumTestProcess):
@ -19,6 +19,6 @@ class TrashMessage(TeleniumTestProcess):
self.cli.sleep(4) self.cli.sleep(4)
self.cli.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[0]') self.cli.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[0]')
self.cli.sleep(2) self.cli.sleep(2)
# self.cli.click_on('//MDDialog/MDCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]') self.cli.click_on('//MDDialog/MDCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]')
self.cli.click_on('//MDDialog/DialogFakeCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]') # self.cli.click_on('//MDDialog/DialogFakeCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]')
self.cli.sleep(4) self.cli.sleep(4)

View File

@ -9,7 +9,7 @@ def unittest_discover():
"""Explicit test suite creation""" """Explicit test suite creation"""
loader = unittest.defaultTestLoader loader = unittest.defaultTestLoader
loader.sortTestMethodsUsing = lambda a, b: random.randint(-1, 1) loader.sortTestMethodsUsing = lambda a, b: random.randint(-1, 1)
return loader.discover('bitmessagekivy.tests') return loader.discover('src.bitmessagekivy.tests')
if __name__ == "__main__": if __name__ == "__main__":