forked from conda-incubator/conda-store
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move build to worker (conda-incubator#945)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
463fc7c
commit 2daec59
Showing
3 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
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,44 @@ | ||
# Copyright (c) conda-store development team. All rights reserved. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file. | ||
|
||
from conda_store_server import api | ||
from conda_store_server._internal import schema | ||
from conda_store_server._internal.worker import build | ||
|
||
|
||
def test_build_started(db, seed_conda_store): | ||
test_build = api.get_build(db, build_id=4) | ||
assert test_build.status != schema.BuildStatus.BUILDING | ||
build.set_build_started(db, test_build) | ||
test_build = api.get_build(db, build_id=4) | ||
assert test_build.status == schema.BuildStatus.BUILDING | ||
|
||
|
||
def test_build_failed(db, seed_conda_store): | ||
test_build = api.get_build(db, build_id=4) | ||
assert test_build.status != schema.BuildStatus.FAILED | ||
build.set_build_failed(db, test_build) | ||
test_build = api.get_build(db, build_id=4) | ||
assert test_build.status == schema.BuildStatus.FAILED | ||
|
||
|
||
def test_build_canceled(db, seed_conda_store): | ||
test_build = api.get_build(db, build_id=4) | ||
assert test_build.status != schema.BuildStatus.CANCELED | ||
build.set_build_canceled(db, test_build) | ||
test_build = api.get_build(db, build_id=4) | ||
assert test_build.status == schema.BuildStatus.CANCELED | ||
|
||
|
||
def test_build_completed(db, conda_store, seed_conda_store): | ||
test_build = api.get_build(db, build_id=2) | ||
assert test_build.status != schema.BuildStatus.COMPLETED | ||
build.set_build_completed(db, conda_store, test_build) | ||
test_build = api.get_build(db, build_id=2) | ||
assert test_build.status == schema.BuildStatus.COMPLETED | ||
assert test_build.environment.current_build == test_build | ||
build_artifact = api.get_build_artifact( | ||
db, 2, str(test_build.build_path(conda_store)) | ||
) | ||
assert build_artifact is not None |