Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Base Worker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Workers
Base Worker
Commits
0b2ee596
Commit
0b2ee596
authored
2 years ago
by
NolanB
Browse files
Options
Downloads
Patches
Plain Diff
Commit for help fixing tests after add TrainingWorker class
parent
26e02ac0
No related branches found
No related tags found
No related merge requests found
Pipeline
#79368
failed
2 years ago
Stage: test
Stage: build
Stage: release
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arkindex_worker/worker/training.py
+1
-0
1 addition, 0 deletions
arkindex_worker/worker/training.py
tests/test_elements_worker/test_training.py
+8
-5
8 additions, 5 deletions
tests/test_elements_worker/test_training.py
with
9 additions
and
5 deletions
arkindex_worker/worker/training.py
+
1
−
0
View file @
0b2ee596
...
...
@@ -128,6 +128,7 @@ class TrainingMixin(object):
):
logger
.
error
(
model_version_details
[
0
])
return
return
model_version_details
def
upload_to_s3
(
self
,
archive_path
:
str
,
model_version_details
:
dict
)
->
None
:
...
...
This diff is collapsed.
Click to expand it.
tests/test_elements_worker/test_training.py
+
8
−
5
View file @
0b2ee596
...
...
@@ -5,10 +5,15 @@ from pathlib import Path
import
responses
from
responses
import
matchers
from
arkindex
.mock
import
MockApiClient
from
arkindex
_worker.worker
import
BaseWorker
from
arkindex_worker.worker.training
import
TrainingMixin
,
create_archive
class
TrainingWorker
(
BaseWorker
,
TrainingMixin
):
def
__init__
(
self
):
super
().
setup_api_client
()
def
test_create_archive_folder
():
model_file_dir
=
Path
(
"
tests/samples/model_files
"
)
...
...
@@ -28,15 +33,13 @@ def test_create_archive_folder():
def
test_create_model_version
():
api_client
=
MockApiClient
()
"""
A new model version is returned
"""
model_id
=
"
fake_model_id
"
model_version_id
=
"
fake_model_version_id
"
# Create a model archive and keep its hash and size.
model_files_dir
=
Path
(
"
tests/samples/model_files
"
)
# model_file_path = model_files_dir / "model_file.pth"
training
=
Training
Mixin
()
training
=
Training
Worker
()
with
create_archive
(
path
=
model_files_dir
)
as
(
zst_archive_path
,
hash
,
...
...
@@ -66,7 +69,7 @@ def test_create_model_version():
)
assert
(
training
.
create_model_version
(
api_client
,
model_id
,
hash
,
size
,
archive_hash
)
training
.
create_model_version
(
model_id
,
hash
,
size
,
archive_hash
)
==
model_version_details
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment