b748edea45
* Add multipart/form-data functionality * Fix some linting issues * Fix error message * Allow filename to be provided with content * Add integration test * Update examples * General improvements to multipart handling * Use prepare_multipart for galaxy collection publish * Properly account for py2 vs py3, ensuring no max header length * Address test assumptions * Add unit tests * Add changelog * Ensure to use CRLF instead of NL * Ignore line-endings in fixture * Consolidate code, add comment * Bump fallaxy container version * ci_complete
46 lines
2 KiB
YAML
46 lines
2 KiB
YAML
---
|
|
- name: fail to publish with no token - {{ test_name }}
|
|
command: ansible-galaxy collection publish ansible_test-my_collection-1.0.0.tar.gz -s {{ test_server }} {{ galaxy_verbosity }}
|
|
args:
|
|
chdir: '{{ galaxy_dir }}'
|
|
register: fail_no_token
|
|
failed_when: '"HTTP Code: 401" not in fail_no_token.stderr'
|
|
|
|
- name: fail to publish with invalid token - {{ test_name }}
|
|
command: ansible-galaxy collection publish ansible_test-my_collection-1.0.0.tar.gz -s {{ test_server }} --token fail {{ galaxy_verbosity }}
|
|
args:
|
|
chdir: '{{ galaxy_dir }}'
|
|
register: fail_invalid_token
|
|
failed_when: '"HTTP Code: 401" not in fail_invalid_token.stderr'
|
|
|
|
- name: publish collection - {{ test_name }}
|
|
command: ansible-galaxy collection publish ansible_test-my_collection-1.0.0.tar.gz -s {{ test_server }} --token {{ fallaxy_token }} {{ galaxy_verbosity }}
|
|
args:
|
|
chdir: '{{ galaxy_dir }}'
|
|
register: publish_collection
|
|
|
|
- name: get result of publish collection - {{ test_name }}
|
|
uri:
|
|
url: '{{ test_server }}v2/collections/ansible_test/my_collection/versions/1.0.0/'
|
|
return_content: yes
|
|
register: publish_collection_actual
|
|
|
|
- name: assert publish collection - {{ test_name }}
|
|
assert:
|
|
that:
|
|
- '"Collection has been successfully published and imported to the Galaxy server" in publish_collection.stdout'
|
|
- publish_collection_actual.json.metadata.name == 'my_collection'
|
|
- publish_collection_actual.json.metadata.namespace == 'ansible_test'
|
|
- publish_collection_actual.json.metadata.version == '1.0.0'
|
|
|
|
- name: fail to publish existing collection version - {{ test_name }}
|
|
command: ansible-galaxy collection publish ansible_test-my_collection-1.0.0.tar.gz -s {{ test_server }} --token {{ fallaxy_token }} {{ galaxy_verbosity }}
|
|
args:
|
|
chdir: '{{ galaxy_dir }}'
|
|
register: fail_publish_existing
|
|
failed_when: '"Artifact already exists" not in fail_publish_existing.stderr'
|
|
|
|
- name: reset published collections - {{ test_name }}
|
|
uri:
|
|
url: '{{ test_server }}custom/reset/'
|
|
method: POST
|