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

Export tests results kiwi #446

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a15c59a
Add plugin config to workflow
acosta434 Nov 21, 2023
e774af1
Enable ui tests
acosta434 Nov 21, 2023
b98afff
Merge branch 'main' into export-tests-results-kiwi
acosta434 Nov 21, 2023
5a5e9f3
Fix run command
acosta434 Nov 21, 2023
ffcc417
Disable ui tests
acosta434 Nov 21, 2023
4bdc6e4
Revert changes to make-commands
acosta434 Nov 21, 2023
f4213e3
Add demo files for test
acosta434 Nov 28, 2023
8aff61f
Add make-junit
acosta434 Nov 28, 2023
922f95b
update req file
acosta434 Nov 28, 2023
8c50423
remove failing req
acosta434 Nov 28, 2023
32c32ab
Loosen package version range
acosta434 Nov 28, 2023
4ddb53c
comment out failing commands
acosta434 Nov 28, 2023
6937ced
remove flake8
acosta434 Nov 28, 2023
638392d
re-enable ci commands
acosta434 Nov 28, 2023
5160cae
trying some setting out
acosta434 Nov 28, 2023
6c38b76
Remove duplicate steps
acosta434 Nov 29, 2023
0278cde
change names for clarity
acosta434 Nov 29, 2023
066599f
missed name change
acosta434 Nov 29, 2023
c85e061
Use action
acosta434 Nov 29, 2023
a03b774
add kiwi url
acosta434 Nov 29, 2023
819d748
Add test credentials
acosta434 Nov 29, 2023
e06cc5d
update version
acosta434 Nov 30, 2023
11c9853
remove failing steps
acosta434 Nov 30, 2023
b761332
remove version keyword
acosta434 Nov 30, 2023
0a65ddb
chsnge version value
acosta434 Nov 30, 2023
1db7788
version test value
acosta434 Nov 30, 2023
456a3e9
run plugin directly
acosta434 Dec 1, 2023
fbfa73d
remove quotes from url
acosta434 Dec 1, 2023
f905776
update plugin version
acosta434 Dec 4, 2023
18b7a0d
remove version - add plan id
acosta434 Dec 4, 2023
9135bc1
Merge branch 'main' into export-tests-results-kiwi
acosta434 Dec 4, 2023
3061371
add version back
acosta434 Dec 4, 2023
494e967
Merge branch 'export-tests-results-kiwi' of https://github.com/willow…
acosta434 Dec 4, 2023
e122f91
fix typo
acosta434 Dec 5, 2023
e63c346
use github.ref for version
acosta434 Dec 5, 2023
93b68c1
remove version from plugin install
acosta434 Dec 5, 2023
243a8a6
remove upstream config
acosta434 Dec 5, 2023
4e8259b
add sudo commands from example
acosta434 Dec 5, 2023
ee1123b
remove sudo commands
acosta434 Dec 5, 2023
07c84ad
removing previous setup
acosta434 Dec 5, 2023
0abc545
add back $name
acosta434 Dec 5, 2023
4a4fa34
test values
acosta434 Dec 5, 2023
ff11c97
confirmed version
acosta434 Dec 5, 2023
d28ec2d
setup example test reporter
acosta434 Dec 5, 2023
5d74b01
change sequence
acosta434 Dec 5, 2023
29863a1
remove nose and matrix
acosta434 Dec 5, 2023
ab00b7d
remove filename pattern
acosta434 Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -22,16 +24,52 @@ jobs:
distribution: 'temurin'
cache: gradle

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install Python dependencies
run: |
pip install -U pip wheel
pip install -r devel.txt

- name: Run Unit Tests
run: ./gradlew testDebug

# - name: Run UI Tests
# run: ./gradlew connectedDebugAndroidTest

- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: app/build/reports/

- name: Install kiwitcms plugin and create config
run: |
pip install git+https://github.com/kiwitcms/[email protected]
cat > ~/.tcms.conf << _EOF
[tcms]
url = https://vocable.wtadev.com/xml-rpc/
username = kiwi_bot
password = UgAco3GdHhLEyU7zZNZ8
_EOF
shell: bash

- name: Run kiwitcms export
run: tcms-junit.xml-plugin $([ "false" == "true" ] && echo "-v") --summary-template '${classname}.${name}' ./app/build/reports/*.xml
shell: bash
env:
TCMS_PREFIX: "Vocable Android 2022"
TCMS_PLAN_ID: "8"
# TCMS_PARENT_PLAN - if defined newly created TestPlan will be a child of this one
# TCMS_RUN_ID - if defined will report results to this TestRun
TCMS_PRODUCT: "Vocable Android"
TCMS_PRODUCT_VERSION: "1.4"
TCMS_BUILD: ${{ github.sha }}

- name: Assemble Debug Variant
env:
VERSION_CODE: ${{ github.run_number }}
Expand Down
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.PHONY: flake8
flake8:
@flake8 *.py tcms_junit_plugin tests


.PHONY: pylint
pylint:
pylint -d missing-docstring *.py tcms_junit_plugin/
pylint --load-plugins=pylint.extensions.no_self_use \
-d missing-docstring -d invalid-name -d too-few-public-methods \
-d protected-access -d duplicate-code tests/


.PHONY: test
test:
nose2 -v --with-coverage --coverage tcms_junit_plugin


.PHONY: export-kiwi
export:
./app/build/test-results/testDebugUnitTest/*.xml


.PHONY: check-build
check-build:
./tests/bin/check-build


.PHONY: ci
ci: test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.hamcrest.CoreMatchers.instanceOf

class MainScreen {

val defaultCategories = arrayOf("General", "Basic Needs", "Personal Care", "Conversation", "Environment", "123", "My Sayings")
val defaultCategories = arrayOf("General", "Basic Needs", "Personal Care", "Conversation", "Environment", "123", "Recents")
val defaultPhraseGeneral = arrayOf("Please", "Yes", "Maybe", "I don't know", "Thank you", "No", "Please wait", "I didn't mean to say that")
val defaultPhraseBasicNeeds = arrayOf("I need to go to the restroom", "I am hungry", "I am hot", "I am fine", "I am thirsty", "I am cold", "I am tired", "I am good")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MainScreenTest : BaseTest() {

private val mainScreen = MainScreen()

@Ignore
// @Ignore
@Test
fun verifyDefaultTextAppears() {
mainScreen.apply {
Expand All @@ -21,7 +21,7 @@ class MainScreenTest : BaseTest() {
}
}

@Ignore
// @Ignore
@Test
fun verifyClickingPhraseUpdatesCurrentText() {
mainScreen.apply {
Expand All @@ -30,15 +30,15 @@ class MainScreenTest : BaseTest() {
}
}

@Ignore
//@Ignore
@Test
fun verifyDefaultCategoriesExist() {
mainScreen.apply {
verifyDefaultCategoriesExist()
}
}

@Ignore
//@Ignore
@Test
fun verifyDefaultSayingsInCategoriesExist() {
mainScreen.apply {
Expand All @@ -47,7 +47,7 @@ class MainScreenTest : BaseTest() {
}
}

@Ignore
//@Ignore
@Test
fun verifySelectingCategoryChangesPhrases() {
mainScreen.apply {
Expand Down
10 changes: 10 additions & 0 deletions devel.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-r requirements.txt

black
nose2[coverage_plugin]
coverage
flake8
pylint
twine
pyOpenSSL
readme_renderer[md]
12 changes: 12 additions & 0 deletions make-junit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

# Execute this from the project root directory
# nose2 --verbose --plugin nose2.plugins.junitxml --junit-xml

./tcms-junit.xml-plugin --verbose \
# nose2-junit.xml \
# tests/data/9.xml \
# tests/data/mocha.js.xml
app/build/reports/*.xml
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
junitparser>=1.1.0
tcms-api==12.2
nose-tap
kiwitcms-junit.xml-plugin
49 changes: 49 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python
# pylint: disable=missing-docstring
import os

from setuptools import setup


def get_version():
version_py_path = os.path.join("tcms_junit_plugin", "version.py")
with open(version_py_path, encoding="utf-8") as version_file:
version = version_file.read()
return version.replace(" ", "").replace("__version__=", "").strip().strip("'").strip('"')


with open("README.rst", encoding="utf-8") as readme:
LONG_DESCRIPTION = readme.read()


with open("requirements.txt", encoding="utf-8") as requirements:
REQUIREMENTS = requirements.readlines()


setup(
name="kiwitcms-junit.xml-plugin",
version=get_version(),
packages=["tcms_junit_plugin"],
scripts=["tcms-junit.xml-plugin"],
description="junit.xml plugin for " "Kiwi TCMS test case management system",
long_description=LONG_DESCRIPTION,
author="Kiwi TCMS",
author_email="[email protected]",
license="GPLv3+",
url="https://github.com/kiwitcms/junit.xml-plugin",
install_requires=REQUIREMENTS,
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
],
)
11 changes: 11 additions & 0 deletions tcms.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[tcms]
url = https://vocable.wtadev.com/xml-rpc/
username = kiwi-bot
password = UgAco3GdHhLEyU7zZNZ8

# define environment variables
pytest -p tcms_pytest_plugin --kiwitcms
TCMS_PLAN_ID=8
TCMS_RUN_ID=7

tcms-junit.xml-plugin /app/build/test-results/testDebugUnitTest/binary
Loading