-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a testflinger_common module with example usage (#275)
* Add a testflinger_common module with example usage * Add the testflinger_common project to what gets installed by the charm * Make it easier to test new branches of the charm with the config option
- Loading branch information
Showing
8 changed files
with
214 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Testflinger Common | ||
================== | ||
|
||
The testflinger_common module may be used to store code that is useful to | ||
multiple projects so that it only needs to be defined once. | ||
|
||
There is no standalone script for testflinger_common as it is only intended | ||
to be imported and used by other projects. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[tool.setuptools] | ||
packages = ["testflinger_common"] | ||
|
||
[tool.poetry] | ||
name = "testflinger-common" | ||
description = "Testflinger common modules" | ||
readme = "README.rst" | ||
version = "1.1.0" | ||
authors = [] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" # specify your Python version requirement here | ||
strenum = "^0.4.15" | ||
|
||
[tool.poetry.dev-dependencies] | ||
pytest = "^8.1.2" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.black] | ||
line-length = 79 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (C) 2024 Canonical | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
""" | ||
Job State and Test Phase Enums | ||
""" | ||
|
||
from strenum import StrEnum | ||
|
||
|
||
class JobState(StrEnum): | ||
WAITING = "waiting" | ||
SETUP = "setup" | ||
PROVISION = "provision" | ||
FIRMWARE_UPDATE = "firmware_update" | ||
TEST = "test" | ||
ALLOCATE = "allocate" | ||
ALLOCATED = "allocated" | ||
RESERVE = "reserve" | ||
CLEANUP = "cleanup" | ||
CANCELLED = "cancelled" | ||
COMPLETED = "completed" | ||
|
||
|
||
class TestPhase(StrEnum): | ||
SETUP = "setup" | ||
PROVISION = "provision" | ||
FIRMWARE_UPDATE = "firmware_update" | ||
TEST = "test" | ||
ALLOCATE = "allocate" | ||
RESERVE = "reserve" | ||
CLEANUP = "cleanup" | ||
|