Skip to content

Commit

Permalink
Merge release v1.1.2 into main (#256)
Browse files Browse the repository at this point in the history
* Bump fastapi to 0.109.1

* Write container logs to file

* Fix tls test module

* Pin dependencies

* Change error message for testrun already running (#262)

* Change error message for testrun already running

* Update testing scripts

* Bump vite and @angular-devkit/build-angular in /modules/ui (#265)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) to 4.5.2 and updates ancestor dependency [@angular-devkit/build-angular](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Updates `vite` from 4.5.1 to 4.5.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite)

Updates `@angular-devkit/build-angular` from 16.2.11 to 16.2.12
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](angular/angular-cli@16.2.11...16.2.12)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
- dependency-name: "@angular-devkit/build-angular"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update URL used by UI (#266)

* formatting/pylint score

* Bump version

* Allow modification of API URL

* Resolve container logs on separate thread to prevent blocking

* Add appropriate headings (#258)

* TLSv1.3 server bug fix

* Enable save button when only one interface is available (#271)

* Bump version

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Sofia Kurilova <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jhughesbiot <[email protected]>
  • Loading branch information
4 people authored Feb 19, 2024
1 parent 8d18ac5 commit 3177827
Show file tree
Hide file tree
Showing 40 changed files with 976 additions and 198 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
timeout-minutes: 20
steps:
- name: Checkout source
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install dependencies
shell: bash {0}
run: cmd/prepare
Expand All @@ -36,7 +36,7 @@ jobs:
timeout-minutes: 45
steps:
- name: Checkout source
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install dependencies
shell: bash {0}
run: cmd/prepare
Expand All @@ -53,7 +53,7 @@ jobs:
if: ${{ always() }}
run: sudo tar --exclude-vcs -czf runtime.tgz /usr/local/testrun/runtime/
- name: Upload runtime results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
if: ${{ always() }}
with:
if-no-files-found: error
Expand All @@ -67,7 +67,7 @@ jobs:
timeout-minutes: 40
steps:
- name: Checkout source
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install dependencies
shell: bash {0}
run: cmd/prepare
Expand All @@ -85,7 +85,7 @@ jobs:
if: ${{ always() }}
run: sudo tar --exclude-vcs -czf runtime.tgz /usr/local/testrun/runtime/ /usr/local/testrun/local/
- name: Upload runtime results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
if: ${{ always() }}
with:
if-no-files-found: error
Expand All @@ -99,7 +99,7 @@ jobs:
timeout-minutes: 5
steps:
- name: Checkout source
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run pylint
shell: bash {0}
run: testing/pylint/test_pylint
Expand All @@ -111,12 +111,12 @@ jobs:
timeout-minutes: 5
steps:
- name: Checkout source
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Package Testrun
shell: bash {0}
run: cmd/package
- name: Archive package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
with:
name: testrun_installer
path: testrun*.deb
Expand All @@ -126,9 +126,9 @@ jobs:
name: UI
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Node
uses: actions/setup-node@v4
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: 18.10.0
- name: Install Chromium Browser
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ error
pylint.out
__pycache__/
build/

# Ignore generated files from unit tests
testing/unit_test/temp/
*.deb
testing/unit/tls/output/

*.deb
make/DEBIAN/postinst
2 changes: 1 addition & 1 deletion cmd/package
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ cp -r {framework,modules} $MAKE_SRC_DIR/usr/local/testrun
dpkg-deb --build --root-owner-group make

# Rename the .deb file
mv make.deb testrun_1-1-1_amd64.deb
mv make.deb testrun_1-1-2_amd64.deb
3 changes: 2 additions & 1 deletion framework/python/src/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ async def start_test_run(self, request: Request, response: Response):
]:
LOGGER.debug("Testrun is already running. Cannot start another instance")
response.status_code = status.HTTP_409_CONFLICT
return self._generate_msg(False, "Testrun is already running")
return self._generate_msg(False, "Testrun cannot be started " +
"whilst a test is running on another device")

# Check if requested device is known in the device repository
if device is None:
Expand Down
8 changes: 8 additions & 0 deletions framework/python/src/common/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
MONITOR_PERIOD_KEY = 'monitor_period'
STARTUP_TIMEOUT_KEY = 'startup_timeout'
LOG_LEVEL_KEY = 'log_level'
API_URL_KEY = 'api_url'
API_PORT_KEY = 'api_port'
MAX_DEVICE_REPORTS_KEY = 'max_device_reports'

Expand Down Expand Up @@ -80,6 +81,7 @@ def _get_default_config(self):
'startup_timeout': 60,
'monitor_period': 30,
'max_device_reports': 5,
'api_url': 'http://localhost',
'api_port': 8000
}

Expand Down Expand Up @@ -117,6 +119,9 @@ def _load_config(self):
if LOG_LEVEL_KEY in config_file_json:
self._config[LOG_LEVEL_KEY] = config_file_json.get(LOG_LEVEL_KEY)

if API_URL_KEY in config_file_json:
self._config[API_URL_KEY] = config_file_json.get(API_URL_KEY)

if API_PORT_KEY in config_file_json:
self._config[API_PORT_KEY] = config_file_json.get(API_PORT_KEY)

Expand Down Expand Up @@ -164,6 +169,9 @@ def get_monitor_period(self):
def get_startup_timeout(self):
return self._config.get(STARTUP_TIMEOUT_KEY)

def get_api_url(self):
return self._config.get(API_URL_KEY)

def get_api_port(self):
return self._config.get(API_PORT_KEY)

Expand Down
31 changes: 20 additions & 11 deletions framework/python/src/common/testreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def generate_pages(self, json_data):

def generate_page(self, json_data, page_num, max_page):
# Placeholder until available in json report
version = 'v1.1.1 (2024-01-31)'
version = 'v1.1.2 (2024-02-16)'
page = '<div class="page">'
page += self.generate_header(json_data)
if page_num == 1:
Expand Down Expand Up @@ -222,7 +222,7 @@ def generate_results(self, json_data, page_num):
result_list = '''
<img style="margin-bottom:10px;width:100%;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABFgAAAABCAYAAADqzRqJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA3SURBVHgB7cAxAQAQFEXRJ4MIMkjwS9hklMCoi1EBWljePWlHvQIAMy2mAMDNKV3ADysPAYCbB6fxBrzkZ2KOAAAAAElFTkSuQmCC" />
<div class="result-list">
<span class="result-list-title">Results List</span>
<h3>Results List</h3>
<div class="result-line" style="margin-top: 10px;border-top-left-radius:4px;border-top-right-radius:4px;">
<div class="result-list-header-label" style="left: .1in">Name</div>
<div class="result-list-header-label" style="left: 2.8in">Description</div>
Expand Down Expand Up @@ -264,8 +264,8 @@ def generate_header(self, json_data):
tr_img_b64 = base64.b64encode(f.read()).decode('utf-8')
return f'''
<div class="header">
<h3 class="header-text">Testrun report</h3>
<h1 class="header-title" style="top: 50%;">{json_data["device"]["manufacturer"]} {json_data["device"]["model"]}</h1>
<h1>Testrun report</h1>
<h2 style="top: 50%;">{json_data["device"]["manufacturer"]} {json_data["device"]["model"]}</h2>
<img src="data:image/png;base64,{tr_img_b64}" alt="Test Run" width="90" style="position: absolute;top: 40%; right: 0px;"></img>
</div>
'''
Expand Down Expand Up @@ -299,7 +299,7 @@ def generate_summary(self, json_data):
summary += '''
<div class="summary-device-modules">
<div class="summary-item-label" style="margin-bottom:10px;">
Device Configuration
<h4>Device Configuration</h4>
</div>
'''

Expand Down Expand Up @@ -379,7 +379,7 @@ def generate_result_summary_item(self, key, value, style=None):

def generate_device_summary_label(self, key, value, trailing_space=True):
label = f'''
<div class="summary-item-label">{key}</div>
<div class="summary-item-label"><h4>{key}</h4></div>
<div class="summary-item-value">{value}</div>
'''
if trailing_space:
Expand Down Expand Up @@ -457,18 +457,30 @@ def generate_css(self):
position: relative;
}
.header-text {
h1 {
margin: 0 0 8px 0;
font-size: 20px;
font-weight: 400;
}
.header-title {
h2 {
margin: 0px;
font-size: 48px;
font-weight: 700;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 12px;
font-weight: 500;
color: #5F6368;
margin-bottom: 0;
margin-top: 0;
}
/* Define the summary related css elements*/
.summary-content {
position: relative;
Expand All @@ -480,9 +492,6 @@ def generate_css(self):
.summary-item-label {
position: relative;
font-size: 12px;
font-weight: 500;
color: #5F6368;
}
.summary-item-value {
Expand Down
Loading

0 comments on commit 3177827

Please sign in to comment.