Skip to content

Commit 283d0a0

Browse files
authored
Merge pull request #116 from ansiblebit/develop
test improvements
2 parents 4ff4d15 + 3b52b41 commit 283d0a0

File tree

6 files changed

+51
-22
lines changed

6 files changed

+51
-22
lines changed

.yamllint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# Based on ansible-lint config
3+
extends: default
4+
5+
rules:
6+
braces: {max-spaces-inside: 1, level: error}
7+
brackets: {max-spaces-inside: 1, level: error}
8+
colons: {max-spaces-after: -1, level: error}
9+
commas: {max-spaces-after: -1, level: error}
10+
comments: disable
11+
comments-indentation: disable
12+
document-start: disable
13+
empty-lines: {max: 3, level: error}
14+
hyphens: {level: error}
15+
indentation: disable
16+
key-duplicates: enable
17+
line-length: disable
18+
new-line-at-end-of-file: disable
19+
new-lines: {type: unix}
20+
trailing-spaces: disable
21+
truthy: disable

tasks/check_environment.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88

99
- name: determine if Java is already installed
10-
shell: which java
10+
command: which java
1111
register: oracle_java_task_installed
1212
changed_when: oracle_java_task_installed.rc != 0
1313
failed_when: no
@@ -19,7 +19,12 @@
1919
oracle_java_installed={{ not oracle_java_task_installed.changed }}
2020

2121
- name: determine which Java version is installed
22-
shell: java -version 2>&1 | head -n 1 | awk '{ print $3 }' | awk -F '"' '{ print $2 }'
22+
shell: |
23+
set -o pipefail |
24+
java -version 2>&1 |
25+
head -n 1 |
26+
awk '{ print $3 }' |
27+
awk -F '"' '{ print $2 }'
2328
register: oracle_java_task_version
2429
when: oracle_java_installed
2530
changed_when: False

tasks/darwin/macosx.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@
1919
tags:
2020
- installation
2121

22-
- name: mount DMG image
23-
shell: echo TODO
24-
tags:
25-
- installation
22+
# - name: mount DMG image
23+
# shell: echo TODO
24+
# tags:
25+
# - installation
2626

27-
- name: install JDK
28-
shell: echo TODO
29-
tags:
30-
- installation
27+
# - name: install JDK
28+
# shell: echo TODO
29+
# tags:
30+
# - installation
3131

32-
- name: unmount DMG image
33-
shell: echo TODO
34-
tags:
35-
- installation
32+
# - name: unmount DMG image
33+
# shell: echo TODO
34+
# tags:
35+
# - installation
3636

37-
- name: set Java version as default
38-
shell: echo TODO
39-
when: oracle_java_set_as_default
40-
register: oracle_java_task_set_default
41-
become: yes
37+
# - name: set Java version as default
38+
# shell: echo TODO
39+
# when: oracle_java_set_as_default
40+
# register: oracle_java_task_set_default
41+
# become: yes
4242

4343
- name: in case there were changes, check host environment again
4444
include: ../check_environment.yml

tasks/installation/debian/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
- name: debian | set Java version as default
4040
apt:
4141
name="{{ oracle_java_debconf_package_default }}"
42-
state=latest
42+
state=present
4343
register: oracle_java_task_set_default
4444
when: oracle_java_set_as_default
4545
become: yes

tests/tasks/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@
4141
- keytool
4242
- java
4343
- javadoc
44-

tox.ini

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{36}-ansible{27,26,25},py27-{24,23,22,21,20}
3+
py{36}-ansible{28,27,26,25},py27-{24,23,22,21,20}
44

55
skipsdist = True
66

@@ -17,10 +17,14 @@ deps =
1717
ansible22: ansible>=2.2,<2.3
1818
ansible21: ansible>=2.1,<2.2
1919
ansible20: ansible>=2.0.0,<2.1
20+
ansible-lint==4.1.0
21+
yamllint==1.15.0
2022

2123
passenv = ANSIBLE_ASK_SUDO_PASS HOME LANG LC_ALL TRAVIS USER
2224

2325
commands =
26+
yamllint -c ../.yamllint.yml ..
27+
ansible-lint --exclude .tox ..
2428
bash setup.sh
2529
bash travis.sh {posargs}
2630
bash vagrant.sh {posargs}

0 commit comments

Comments
 (0)