Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
eossr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ESCAPE2020
WP3
eossr
Commits
01bc61e7
Commit
01bc61e7
authored
3 years ago
by
Enrique Garcia
Browse files
Options
Downloads
Patches
Plain Diff
tests help for all scripts
parent
f02a330b
No related branches found
No related tags found
1 merge request
!5
Add zenodoapi module
Pipeline
#134620
passed
3 years ago
Stage: install
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+0
-5
0 additions, 5 deletions
.gitlab-ci.yml
eossr/scripts/tests/test_scripts.py
+28
-0
28 additions, 0 deletions
eossr/scripts/tests/test_scripts.py
with
28 additions
and
5 deletions
.gitlab-ci.yml
+
0
−
5
View file @
01bc61e7
...
...
@@ -17,11 +17,6 @@ install_py37:
-
eossr-codemeta2zenodo --help
-
eossr-codemeta2zenodo --input_codemeta_file ./codemeta.json
-
cat .zenodo.json
-
echo "testing all entry points and bash scripts"
-
eossr-upload-new-deposit -h
-
eossr-upload-new-version-deposit -h
-
eossr-check-connection-zenodo -h
-
which parse_last_release_git.sh
only
:
-
branches
...
...
This diff is collapsed.
Click to expand it.
eossr/scripts/tests/test_scripts.py
+
28
−
0
View file @
01bc61e7
# Various tests taken/based from
# https://github.com/cta-observatory/cta-lstchain/blob/master/lstchain/scripts/tests/test_lstchain_scripts.py
import
pytest
import
subprocess
import
pkg_resources
from
os.path
import
dirname
,
realpath
,
join
ROOT_DIR
=
dirname
(
realpath
(
"
codemeta.json
"
))
def
find_entry_points
(
package_name
):
"""
from: https://stackoverflow.com/a/47383763/3838691
"""
entrypoints
=
[
ep
.
name
for
ep
in
pkg_resources
.
iter_entry_points
(
"
console_scripts
"
)
if
ep
.
module_name
.
startswith
(
package_name
)
]
return
entrypoints
ALL_SCRIPTS
=
find_entry_points
(
"
eossr
"
)
def
run_script
(
*
args
):
result
=
subprocess
.
run
(
args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
encoding
=
'
utf-8
'
)
...
...
@@ -16,3 +34,13 @@ def run_script(*args):
def
test_codemeta2zenodo
():
run_script
(
"
eossr-codemeta2zenodo
"
,
"
-i
"
,
join
(
ROOT_DIR
,
"
codemeta.json
"
))
def
test_parse_last_release_git_bash
():
run_script
(
"
which
"
,
"
parse_last_release_git.sh
"
)
@pytest.mark.parametrize
(
"
script
"
,
ALL_SCRIPTS
)
def
test_help_all_scripts
(
script
):
"""
Test for all scripts if at least the help works
"""
run_script
(
script
,
"
--help
"
)
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