Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flame-clmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
flame
flame-clmc
Commits
b3bc6289
Commit
b3bc6289
authored
6 years ago
by
Stephen C Phillips
Browse files
Options
Downloads
Patches
Plain Diff
fixture script requires `-c all` to apply action to all containers
parent
77a5cae1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+15
-15
15 additions, 15 deletions
.gitlab-ci.yml
README.md
+2
-2
2 additions, 2 deletions
README.md
scripts/test/fixture.sh
+9
-2
9 additions, 2 deletions
scripts/test/fixture.sh
with
26 additions
and
19 deletions
.gitlab-ci.yml
+
15
−
15
View file @
b3bc6289
## © University of Southampton IT Innovation Centre, 2018
## © University of Southampton IT Innovation Centre, 2018
##
##
## Copyright in this software belongs to University of Southampton
## Copyright in this software belongs to University of Southampton
## IT Innovation Centre of Gamma House, Enterprise Road,
## IT Innovation Centre of Gamma House, Enterprise Road,
## Chilworth Science Park, Southampton, SO16 7NS, UK.
## Chilworth Science Park, Southampton, SO16 7NS, UK.
##
##
## This software may not be used, sold, licensed, transferred, copied
## This software may not be used, sold, licensed, transferred, copied
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
## Created By : Michael Boniface
## Created By : Michael Boniface
## Created Date : 21-03-2018
## Created Date : 21-03-2018
## Created for Project : FLAME
## Created for Project : FLAME
stages
:
stages
:
-
build
-
build
-
test
-
test
-
clean
-
clean
...
@@ -26,13 +26,13 @@ stages:
...
@@ -26,13 +26,13 @@ stages:
build:tests
:
build:tests
:
stage
:
build
stage
:
build
only
:
only
:
-
schedules
-
schedules
script
:
script
:
-
echo $CI_PROJECT_DIR
-
echo $CI_PROJECT_DIR
-
cd $CI_PROJECT_DIR/src/test
-
cd $CI_PROJECT_DIR/src/test
-
python setup.py sdist --dist-dir=$CI_PROJECT_DIR/build
-
python setup.py sdist --dist-dir=$CI_PROJECT_DIR/build
-
cd $CI_PROJECT_DIR/src/service
-
cd $CI_PROJECT_DIR/src/service
-
python setup.py sdist --dist-dir=$CI_PROJECT_DIR/build
-
python setup.py sdist --dist-dir=$CI_PROJECT_DIR/build
artifacts
:
artifacts
:
paths
:
paths
:
-
build/clmctest-SNAPSHOT.tar.gz
-
build/clmctest-SNAPSHOT.tar.gz
...
@@ -42,28 +42,28 @@ build:tests:
...
@@ -42,28 +42,28 @@ build:tests:
test:all
:
test:all
:
stage
:
test
stage
:
test
only
:
only
:
-
schedules
-
schedules
dependencies
:
dependencies
:
-
build:tests
-
build:tests
script
:
script
:
-
echo "REPO_USER=${REPO_USER}" > $CI_PROJECT_DIR/reporc
-
echo "REPO_USER=${REPO_USER}" > $CI_PROJECT_DIR/reporc
-
echo "REPO_PASS=${REPO_PASS}" >> $CI_PROJECT_DIR/reporc
-
echo "REPO_PASS=${REPO_PASS}" >> $CI_PROJECT_DIR/reporc
-
sudo scripts/test/fixture.sh create -f src/test/clmctest/rspec.json -r $CI_PROJECT_DIR
-
sudo scripts/test/fixture.sh create -f src/test/clmctest/rspec.json -r $CI_PROJECT_DIR
-c all
-
sudo mkdir /var/lib/lxc/test-runner/rootfs/vagrant/build
-
sudo mkdir /var/lib/lxc/test-runner/rootfs/vagrant/build
-
sudo cp build/clmctest-SNAPSHOT.tar.gz /var/lib/lxc/test-runner/rootfs/vagrant/build
-
sudo cp build/clmctest-SNAPSHOT.tar.gz /var/lib/lxc/test-runner/rootfs/vagrant/build
-
sudo cp build/clmcservice-SNAPSHOT.tar.gz /var/lib/lxc/test-runner/rootfs/vagrant/build
-
sudo cp build/clmcservice-SNAPSHOT.tar.gz /var/lib/lxc/test-runner/rootfs/vagrant/build
-
sudo lxc-attach -n test-runner -- pip3 install /vagrant/build/clmctest-SNAPSHOT.tar.gz
-
sudo lxc-attach -n test-runner -- pip3 install /vagrant/build/clmctest-SNAPSHOT.tar.gz
-
sudo lxc-attach -n test-runner -- pip3 install /vagrant/build/clmcservice-SNAPSHOT.tar.gz
-
sudo lxc-attach -n test-runner -- pip3 install /vagrant/build/clmcservice-SNAPSHOT.tar.gz
-
sudo lxc-attach -n test-runner -- pytest -s --tb=short -rfp --pyargs clmctest.scripts
-
sudo lxc-attach -n test-runner -- pytest -s --tb=short -rfp --pyargs clmctest.scripts
-
sudo lxc-attach -n test-runner -- pytest -s --tb=short -rfp --pyargs clmcservice.tests
-
sudo lxc-attach -n test-runner -- pytest -s --tb=short -rfp --pyargs clmcservice.tests
-
sudo lxc-attach -n test-runner -- pytest -s --tb=short -rfp --pyargs clmctest.inputs
-
sudo lxc-attach -n test-runner -- pytest -s --tb=short -rfp --pyargs clmctest.inputs
-
sudo lxc-attach -n test-runner -- pytest -s --tb=short -rfp --pyargs clmctest.monitoring
-
sudo lxc-attach -n test-runner -- pytest -s --tb=short -rfp --pyargs clmctest.monitoring
when
:
on_success
when
:
on_success
clean
:
clean
:
stage
:
clean
stage
:
clean
only
:
only
:
-
schedules
-
schedules
script
:
script
:
-
sudo scripts/test/fixture.sh destroy -f src/test/clmctest/rspec.json
-
sudo scripts/test/fixture.sh destroy -f src/test/clmctest/rspec.json
when
:
always
when
:
always
This diff is collapsed.
Click to expand it.
README.md
+
2
−
2
View file @
b3bc6289
...
@@ -62,14 +62,14 @@ SSH into the VM
...
@@ -62,14 +62,14 @@ SSH into the VM
The containers are controlled using a script called /vagrant/scripts/test/fixtures.sh
The containers are controlled using a script called /vagrant/scripts/test/fixtures.sh
```
```
Usage: fixture.sh create|start|stop|destroy [-f config_file] [-r repo_root] [-c
service
_name]"
Usage: fixture.sh create|start|stop|destroy [-f config_file] [-r repo_root] [-c
container
_name
|all
]"
```
```
To create all the services needed for integration tests
To create all the services needed for integration tests
```
```
sudo su
sudo su
/vagrant/scripts/test/fixture.sh create -f /vagrant/src/test/clmctest/rspec.json
/vagrant/scripts/test/fixture.sh create -f /vagrant/src/test/clmctest/rspec.json
-c all
```
```
The containers created are defined an rspec.json file, there's an example here
`/vagrant/src/test/clmctest/rspec.json`
The containers created are defined an rspec.json file, there's an example here
`/vagrant/src/test/clmctest/rspec.json`
...
...
This diff is collapsed.
Click to expand it.
scripts/test/fixture.sh
+
9
−
2
View file @
b3bc6289
#!/bin/bash
#!/bin/bash
usage
()
{
usage
()
{
echo
"Usage:
$0
create|start|stop|destroy [-f config_file] [-r repo_root] [-c
service
_name]"
1>&2
echo
"Usage:
$0
create|start|stop|destroy [-f config_file] [-r repo_root] [-c
container
_name
|all
]"
1>&2
exit
1
exit
1
}
}
...
@@ -182,12 +182,19 @@ if [ ! -d ${repo_root} ]; then
...
@@ -182,12 +182,19 @@ if [ ! -d ${repo_root} ]; then
exit
1
exit
1
fi
fi
# check a service has been defined
if
[
-z
${
container
}
]
;
then
echo
"A container must be named: use 'all' for all"
usage
exit
1
fi
# iterate of list of services in configuration file
# iterate of list of services in configuration file
command
=
$1
command
=
$1
service_names
=
$(
jq
-r
'.[].name'
${
config_file
}
)
service_names
=
$(
jq
-r
'.[].name'
${
config_file
}
)
for
service_name
in
$service_names
;
do
for
service_name
in
$service_names
;
do
# if all or specific container
# if all or specific container
if
[
-z
${
container
}
]
||
[
${
container
}
=
=
${
service_name
}
]
;
then
if
[
${
container
}
=
all
-o
${
container
}
=
${
service_name
}
]
;
then
case
"
${
command
}
"
in
case
"
${
command
}
"
in
create
)
create
)
create
${
service_name
}
${
config_file
}
${
repo_root
}
create
${
service_name
}
${
config_file
}
${
repo_root
}
...
...
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