Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
c7cf82b1
Commit
c7cf82b1
authored
8 years ago
by
Ryan Sanford
Browse files
Options
Downloads
Patches
Plain Diff
Delay integration tests until core is up
parent
54efa940
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/runtests.sh
+41
-13
41 additions, 13 deletions
bin/runtests.sh
test/docker-compose.yml
+6
-0
6 additions, 0 deletions
test/docker-compose.yml
with
47 additions
and
13 deletions
bin/runtests.sh
+
41
−
13
View file @
c7cf82b1
...
...
@@ -26,21 +26,49 @@ case "$1-$2" in
integration---ci|integration-
)
# Bootstrap and run integration test.
# - always stop and remove docker containers
# - always exit non-zero if either bootstrap or integration tests fail.
# - always exit non-zero if either bootstrap or integration tests fail
# - only execute tests after core is confirmed up
# - only run integration tests on bootstrap success
docker-compose
\
-f
test
/docker-compose.yml
\
run
\
--rm
\
bootstrap
&&
\
docker-compose
\
-f
test
/docker-compose.yml
\
run
\
--rm
\
integration-test
||
\
exit_code
=
1
docker-compose
-f
test
/docker-compose.yml down
# launch core
docker-compose
\
-f
test
/docker-compose.yml
\
up
\
-d
\
scitran-core
&&
# wait for core to be ready.
(
for
((
i
=
1
;
i<
=
30
;
i++
))
do
# ignore return code
apiResponse
=
$(
docker-compose
-f
test
/docker-compose.yml run
--rm
core-check
)
&&
true
# reformat response string for comparison
apiResponse
=
"
${
apiResponse
//[
$'
\r\n
'
]
}
"
if
[
"
${
apiResponse
}
"
==
"200"
]
;
then
>
&2
echo
"INFO: Core API is available."
exit
0
fi
>
&2
echo
"INFO (
${
apiResponse
}
): Waiting for Core API to become available after
${
i
}
attempts to connect."
sleep
1
done
exit
1
)
&&
# execute tests
docker-compose
\
-f
test
/docker-compose.yml
\
run
\
--rm
\
bootstrap
&&
docker-compose
\
-f
test
/docker-compose.yml
\
run
\
--rm
\
integration-test
||
# set failure exit code in the event any previous commands in chain failed.
exit_code
=
1
docker-compose
-f
test
/docker-compose.yml down
-v
exit
$exit_code
;;
integration---watch
)
...
...
This diff is collapsed.
Click to expand it.
test/docker-compose.yml
+
6
−
0
View file @
c7cf82b1
...
...
@@ -40,3 +40,9 @@ services:
-
mongo
volumes
:
-
./integration_tests:/usr/src/tests
core-check
:
extends
:
scitran-base
links
:
-
scitran-core
entrypoint
:
'
'
command
:
curl -sL -k -w "%{http_code}\\n" "http://scitran-core:8080/api" -o /dev/null
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