Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
b9feb57a
Commit
b9feb57a
authored
Aug 14, 2014
by
Ben Patterson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1402 from edx/benp/add-tests-jenkins-worker
Add tests for jenkins_worker role.
parents
be69e1a8
0d3874c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
0 deletions
+63
-0
playbooks/roles/jenkins_worker/tasks/main.yml
+1
-0
playbooks/roles/jenkins_worker/tasks/test.yml
+62
-0
No files found.
playbooks/roles/jenkins_worker/tasks/main.yml
View file @
b9feb57a
...
...
@@ -12,3 +12,4 @@
-
include
:
python.yml
-
include
:
ruby.yml
-
include
:
jscover.yml
-
include
:
test.yml
playbooks/roles/jenkins_worker/tasks/test.yml
0 → 100644
View file @
b9feb57a
---
# Tests for this role
# Set up #
# To get a baseline comparison for timestamp comparisons
# create a testfile and register its stat info
-
name
:
Create test file
file
:
path=testfile state=touch
-
name
:
Stat test file
stat
:
path=testfile
register
:
testfile
# Tests #
-
name
:
Verify java cmd is using v 1.7
shell
:
java -version
register
:
java_version
-
assert
:
that
:
-
"
'1.7.0'
in
java_version.stderr"
# The role is run with a github oauth token passed in
# as github_oauth_token var value.
# This test confirms that the key being used will work
-
name
:
ensure github token works
shell
:
"
github_post_status.py
edx
edx-platform
dddac0b5dddf00c0950daf324e603e4935994954
success
https://jenkins.testeng.edx.org/
\"
Tests
Passed
\"
"
# Run the github_pr_auth script to confirm it reports
# An expected error when there is nothing in the whitelist
-
name
:
ensure github_pr_auth fails as expected
shell
:
"
github_pr_auth.py
edx
edx-platform
2498"
ignore_errors
:
True
register
:
pr_auth_result
-
assert
:
that
:
-
"
'You
can
update
the
whitelist
by'
in
'{{
pr_auth_result.stdout_lines[1]
}}'"
# Run the github_pr_auth script with a value in the whitelist
# to ensure a passing run
-
name
:
ensure github_pr_auth fails as expected
shell
:
"
export
GITHUB_OWNER_WHITELIST=edx
&&
github_pr_auth.py
edx
edx-platform
2498"
# Verify the virtualenv tar is newly-built
-
name
:
Get info on virtualenv tar
stat
:
path={{ jenkins_home }}/edx-venv_clean.tar.gz
register
:
edxvenv
-
assert
:
that
:
# Assert that it was modified at least within the hour
-
"
{{
testfile.stat.mtime
}}
-
{{
edxvenv.stat.mtime
}}
<
3600"
# Tear Down #
-
name
:
Remove test file
file
:
path=testfile state=absent
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment