Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
e3-require
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
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
Code review analytics
Issue 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
ESS EPICS Environment
wrappers
e3-require
Commits
f733dc75
Commit
f733dc75
authored
3 years ago
by
Simon Rose
Browse files
Options
Downloads
Patches
Plain Diff
Added failing test for E3-286
parent
1aa29fcc
No related branches found
No related tags found
1 merge request
!73
E3-286: module dep file recreation
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.pre-commit-config.yaml
+1
-1
1 addition, 1 deletion
.pre-commit-config.yaml
tests/conftest.py
+4
-3
4 additions, 3 deletions
tests/conftest.py
tests/test_build.py
+49
-1
49 additions, 1 deletion
tests/test_build.py
with
54 additions
and
5 deletions
.pre-commit-config.yaml
+
1
−
1
View file @
f733dc75
repos
:
repos
:
-
repo
:
https://github.com/ambv/black
-
repo
:
https://github.com/ambv/black
rev
:
21.1
1b1
rev
:
21.1
2b0
hooks
:
hooks
:
-
id
:
black
-
id
:
black
-
repo
:
https://gitlab.com/PyCQA/flake8
-
repo
:
https://gitlab.com/PyCQA/flake8
...
...
This diff is collapsed.
Click to expand it.
tests/conftest.py
+
4
−
3
View file @
f733dc75
...
@@ -50,13 +50,14 @@ include $(E3_REQUIRE_TOOLS)/driver.makefile
...
@@ -50,13 +50,14 @@ include $(E3_REQUIRE_TOOLS)/driver.makefile
def
add_file
(
self
,
name
):
def
add_file
(
self
,
name
):
(
self
.
module_dir
/
name
).
touch
()
(
self
.
module_dir
/
name
).
touch
()
def
add_to_makefile
(
self
,
makefile_var
,
name
):
def
add_to_makefile
(
self
,
makefile_var
,
value
,
modifier
=
"
+
"
):
assert
modifier
in
[
""
,
"
+
"
,
"
?
"
,
"
:
"
,
"
!
"
]
with
open
(
self
.
makefile
,
"
a
"
)
as
f
:
with
open
(
self
.
makefile
,
"
a
"
)
as
f
:
f
.
write
(
f
"
{
makefile_var
}
+=
{
nam
e
}
\n
"
)
f
.
write
(
f
"
{
makefile_var
}
{
modifier
}
=
{
valu
e
}
\n
"
)
@pytest.fixture
@pytest.fixture
def
wrappers
(
tmpdir
,
request
):
def
wrappers
(
tmpdir
):
class
WrapperFactory
:
class
WrapperFactory
:
def
get
(
self
,
**
kwargs
):
def
get
(
self
,
**
kwargs
):
return
Wrapper
(
Path
(
tmpdir
),
**
kwargs
)
return
Wrapper
(
Path
(
tmpdir
),
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_build.py
+
49
−
1
View file @
f733dc75
import
re
import
re
from
pathlib
import
Path
from
pathlib
import
Path
from
.utils
import
get_env_var
,
run_make
from
.utils
import
get_env_var
,
run_ioc_get_output
,
run_make
MODULE_VERSION
=
"
0.0.0+0
"
MODULE_VERSION
=
"
0.0.0+0
"
MODULE_VERSION_NO_BUILD
=
"
0.0.0
"
MODULE_VERSION_NO_BUILD
=
"
0.0.0
"
...
@@ -116,3 +116,51 @@ def test_header_install_location(wrapper):
...
@@ -116,3 +116,51 @@ def test_header_install_location(wrapper):
for
ext
in
extensions
:
for
ext
in
extensions
:
assert
(
Path
(
cell_path
)
/
"
include
"
/
"
subdir
"
/
f
"
header.
{
ext
}
"
).
is_file
()
assert
(
Path
(
cell_path
)
/
"
include
"
/
"
subdir
"
/
f
"
header.
{
ext
}
"
).
is_file
()
assert
not
(
Path
(
cell_path
)
/
"
include
"
/
f
"
header.
{
ext
}
"
).
is_file
()
assert
not
(
Path
(
cell_path
)
/
"
include
"
/
f
"
header.
{
ext
}
"
).
is_file
()
def
test_updated_dependencies
(
wrappers
):
wrapper_dep
=
wrappers
.
get
()
wrapper_main
=
wrappers
.
get
()
cell_path
=
wrapper_main
.
path
/
"
cellMods
"
old_version
=
"
0.0.0+0
"
wrapper_main
.
add_to_makefile
(
"
REQUIRED
"
,
wrapper_dep
.
name
)
wrapper_main
.
add_to_makefile
(
f
"
{
wrapper_dep
.
name
}
_VERSION
"
,
old_version
,
modifier
=
""
)
rc
,
*
_
=
run_make
(
wrapper_dep
,
"
cellinstall
"
,
E3_CELL_PATH
=
cell_path
,
E3_MODULE_VERSION
=
old_version
,
)
assert
rc
==
0
rc
,
*
_
=
run_make
(
wrapper_main
,
"
cellinstall
"
,
E3_MODULE_VERSION
=
old_version
)
assert
rc
==
0
new_version
=
"
1.0.0+0
"
rc
,
*
_
=
run_make
(
wrapper_dep
,
"
cellinstall
"
,
E3_CELL_PATH
=
cell_path
,
E3_MODULE_VERSION
=
new_version
,
)
assert
rc
==
0
wrapper_main
.
add_to_makefile
(
f
"
{
wrapper_dep
.
name
}
_VERSION
"
,
new_version
,
modifier
=
""
)
rc
,
*
_
=
run_make
(
wrapper_main
,
"
cellinstall
"
,
E3_MODULE_VERSION
=
new_version
)
assert
rc
==
0
rc
,
o
,
_
=
run_ioc_get_output
(
wrapper_main
.
name
,
new_version
,
wrapper_main
.
path
/
"
cellMods
"
)
assert
rc
==
0
assert
f
"
Loaded
{
wrapper_dep
.
name
}
version
{
new_version
}
"
in
o
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