-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add pre-building of slow projects
Added pre-building of project_with_cartridge and default_project before integration tests. Result: ~25-50% faster testing. Closes #390
- Loading branch information
1 parent
e8f3dee
commit 714d564
Showing
8 changed files
with
90 additions
and
90 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
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,48 @@ | ||
import os | ||
import shutil | ||
import subprocess | ||
|
||
import pytest | ||
from project import Project | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def default_project(cartridge_cmd, module_tmpdir): | ||
project = Project(cartridge_cmd, 'default-project', module_tmpdir, 'cartridge') | ||
return project | ||
|
||
|
||
def test_make_project_with_cartridge(project_with_cartridge, cartridge_cmd, tmpdir): | ||
project = project_with_cartridge | ||
dir = os.getenv("CC_TEST_PREBUILT_PROJECTS") | ||
if dir is None: | ||
print("Directory for cartridge-cli integration tests prebuilt projects is not set.\n", | ||
"Please set enviromental variable: CC_TEST_PREBUILT_PROJECTS") | ||
assert dir is not None | ||
path = dir + "/project_with_cartridge" | ||
|
||
cmd = [ | ||
cartridge_cmd, "build", project.path | ||
] | ||
|
||
process = subprocess.run(cmd, cwd=tmpdir) | ||
assert process.returncode == 0 | ||
shutil.copytree(project.path, path) | ||
|
||
|
||
def test_make_default_project(default_project, cartridge_cmd, tmpdir): | ||
project = default_project | ||
dir = os.getenv("CC_TEST_PREBUILT_PROJECTS") | ||
if dir is None: | ||
print("Directory for cartridge-cli integration tests prebuilt projects is not set.\n", | ||
"Please set enviromental variable: CC_TEST_PREBUILT_PROJECTS") | ||
assert dir is not None | ||
path = dir + "/default_project" | ||
|
||
cmd = [ | ||
cartridge_cmd, "build", project.path | ||
] | ||
|
||
process = subprocess.run(cmd, cwd=tmpdir) | ||
assert process.returncode == 0 | ||
shutil.copytree(project.path, path) |
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