File tree Expand file tree Collapse file tree 6 files changed +38
-5
lines changed Expand file tree Collapse file tree 6 files changed +38
-5
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,15 @@ update_conda_linux:
40
40
- conda
41
41
# leave this job for latter deploy jobs (executed on linux only & using conda)
42
42
43
+ check_tests :
44
+ stage : .pre
45
+ script :
46
+ - bash "ci/check_tests.sh"
47
+ tags :
48
+ - bash # no matter macos or linux
49
+ rules :
50
+ - if : $CI_COMMIT_BRANCH # job not needed for latter deploy jobs (executed on linux only)
51
+
43
52
# Base job for jobs looping on Python environment and testing different OS
44
53
.one_for_each_python_version_and_runner_os :
45
54
parallel :
@@ -114,7 +123,7 @@ pages:
114
123
rules :
115
124
- if : $CI_COMMIT_BRANCH # == $CI_DEFAULT_BRANCH
116
125
tags :
117
- - bash # arbitrary choice...
126
+ - shell # arbitrary choice...
118
127
dependencies :
119
128
- tests
120
129
script :
@@ -132,7 +141,7 @@ prepare_metadata:
132
141
rules :
133
142
- if : $CI_COMMIT_TAG
134
143
tags :
135
- - bash # arbitrary choice...
144
+ - shell # arbitrary choice...
136
145
variables :
137
146
VERSION_PYTHON_FILE : leaspy/__init__.py
138
147
VERSION_REGEX : ' ^__version__\s*=\s*[\x27"](.+)[\x27"].*$' # \x27 is for single quote
@@ -196,5 +205,5 @@ releases:
196
205
PKG_VERSION : $PKG_VERSION
197
206
PKG_VERSION_WITHOUT_DEV_SUFFIX : $PKG_VERSION_WITHOUT_DEV_SUFFIX
198
207
trigger :
199
- include : . releases.gitlab-ci.yml
208
+ include : ci/ releases.gitlab-ci.yml
200
209
strategy : depend
Original file line number Diff line number Diff line change 1
- style ".mdlrc.style"
1
+ style "ci/ .mdlrc.style"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ for test_dir in unit_tests functional_tests; do
4
+ # check no missing __init__.py file
5
+ nb_init=$( find tests/$test_dir -type f -name " __init__.py" | wc -l)
6
+ nb_folder=$( find tests/$test_dir -type d -not -name " __*" | wc -l)
7
+ if (( $nb_init != $nb_folder )) ; then
8
+ echo " Missing a '__init__.py' in a test subfolder from $test_dir ."
9
+ exit 1
10
+ fi
11
+
12
+ # check that all tests files begin with test_*
13
+ files_not_beginning_by_test=$( find tests/$test_dir -name " *.py" -not -name " test_*" -not -name " __init__.py" )
14
+ nb_not_beginning_by_test=$( find tests/$test_dir -name " *.py" -not -name " test_*" -not -name " __init__.py" | wc -l)
15
+ if (( $nb_not_beginning_by_test != 0 )) ; then
16
+ echo " Test files not matching 'test_*.py' in $test_dir : $files_not_beginning_by_test "
17
+ exit 1
18
+ fi
19
+
20
+ # TODO? check that all tests classes import LeaspyTestCase?
21
+ done
22
+
23
+ echo " Tests seems OK!"
24
+ exit 0
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ check_env:
40
40
- echo $TAG_WITHOUT_PREFIX
41
41
- echo $PKG_VERSION
42
42
- echo $PKG_VERSION_WITHOUT_DEV_SUFFIX
43
- - envsubst < .pypirc.in > .pypirc # substitute environment variables in template .pypirc
43
+ - envsubst < ci/ .pypirc.in > .pypirc # substitute environment variables in template .pypirc
44
44
# update all packages in conda deploy env for later steps
45
45
- conda upgrade --all --yes
46
46
- ' [[ "$CI_DEBUG" == "1" ]] && conda info || true'
You can’t perform that action at this time.
0 commit comments