-
-
Notifications
You must be signed in to change notification settings - Fork 17
Command args #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Command args #33
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e469330
Added command syntax
pierlauro 9f06ed1
Update changelog and version
pierlauro 1ad17cb
Reformatting
pierlauro da7366b
Update documentation
pierlauro c86ddb0
Reformatting
pierlauro 20d9861
Testing command args
pierlauro acecae8
fixing spacing issue in docs and adding test to run in circleci
vsoch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,5 @@ | ||
| Bootstrap: docker | ||
| From: busybox | ||
|
|
||
| %startscript | ||
| echo "Following arguments: $@" |
This file contains hidden or 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,7 @@ | ||
| version: "1.0" | ||
| instances: | ||
| echo: | ||
| build: | ||
| context: . | ||
| recipe: Singularity | ||
| command: "arg0 arg1 arg2" |
This file contains hidden or 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,59 @@ | ||
| #!/usr/bin/python | ||
|
|
||
| # Copyright (C) 2019-2020 Vanessa Sochat. | ||
|
|
||
| # This Source Code Form is subject to the terms of the | ||
| # Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed | ||
| # with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
|
||
| from scompose.logger import bot | ||
| from scompose.project import Project | ||
| from scompose.utils import run_command | ||
| from time import sleep | ||
| import shutil | ||
| import pytest | ||
| import os | ||
|
|
||
| here = os.path.dirname(os.path.abspath(__file__)) | ||
|
|
||
|
|
||
| def test_command_args(tmp_path): | ||
| bot.clear() ## Clear previously logged messages | ||
|
|
||
| cmd_args = os.path.join(here, "configs", "cmd_args") | ||
| for filename in os.listdir(cmd_args): | ||
| source = os.path.join(cmd_args, filename) | ||
| dest = os.path.join(tmp_path, filename) | ||
| print("Copying %s to %s" % (filename, dest)) | ||
| shutil.copyfile(source, dest) | ||
|
|
||
| # Test the simple apache example | ||
| os.chdir(tmp_path) | ||
|
|
||
| # Check for required files | ||
| assert "singularity-compose.yml" in os.listdir() | ||
|
|
||
| print("Creating project...") | ||
|
|
||
| # Loading project validates config | ||
| project = Project() | ||
|
|
||
| print("Testing build") | ||
| project.build() | ||
|
|
||
| assert "echo.sif" in os.listdir(tmp_path) | ||
|
|
||
| print("Testing view config") | ||
| project.view_config() | ||
|
|
||
| print("Testing up") | ||
| project.up() | ||
|
|
||
| print("Waiting for instances to start") | ||
| sleep(10) | ||
|
|
||
| print("Bringing down") | ||
| project.down() | ||
|
|
||
| log = bot.get_logs() | ||
| assert "echo arg0 arg1 arg2" in log |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.