Skip to content

Commit

Permalink
Update dependencies + update to OPTIMADE API v1.1.0 (#69)
Browse files Browse the repository at this point in the history
Update dependencies and GH Actions:

* Bump bats/bats from 1.2.1 to v1.4.1 in /tests
* Bump CasperWA/push-protected from 2.3.0 to 2.4.0

Update to OPTIMADE API v1.1.0.
Update > v1.0.0 API test for `all_versioned_paths`.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
CasperWA and dependabot[bot] committed Aug 20, 2021
1 parent 74a70cb commit ca41f89
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def check_output(expected_keys: list):

cmd_output_mapping = {
"default": ["v1"],
"all_versioned_paths": ["v1", "v1.0", "v1.0.1"],
"all_versioned_paths": ["v1", "v1.1", "v1.1.0"],
"validate_unversioned_path": ["unversioned", "v1"],
"as_type": ["astype"],
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_vMAJOR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: .github/update_version/update_version.sh

- name: Update '${{ env.PUBLISH_UPDATE_BRANCH }}'
uses: CasperWA/push-protected@v2.3.0
uses: CasperWA/push-protected@v2.4.0
with:
token: ${{ secrets.RELEASE_PAT_CASPER }}
branch: ${{ env.PUBLISH_UPDATE_BRANCH }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validator_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ jobs:
uses: ./
with:
port: 3213
path: /v1.0/structures
path: /v1.1/structures
create output: true
as type: structures

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# File used for tests
/tests/.entrypoint-run_validator.txt
*.entrypoint-run_validator.txt
/tests/.entrypoint.sh
*v*.json
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ with:
index: yes
```
To run `optimade-validator` for a regular OPTIMADE _deployed_ implementation, testing all possible versioned base URLs:
To run `optimade-validator` for a regular OPTIMADE _deployed_ implementation, testing all possible versioned base URLs, for example:

- `https://example.org:443/optimade/example/v1`
- `https://example.org:443/optimade/example/v1.0`
Expand Down Expand Up @@ -128,5 +128,5 @@ To keep it simple, this overview will only consider the major versions of this A

| Action version | `optimade` package versions | Supported OPTIMADE API specification version(s) |
| :---: | :---: | :---: |
| [`v2`](https://github.com/Materials-Consortia/optimade-validator-action/releases/tag/v2.0.0) | [`v0.10.0`](https://github.com/Materials-Consortia/optimade-python-tools/releases/v0.10.0)+ | [`v1.0.0`](https://github.com/Materials-Consortia/OPTIMADE/blob/v1.0.0/optimade.rst) |
| [`v2`](https://github.com/Materials-Consortia/optimade-validator-action/releases/tag/v2.0.0) | [`v0.10.0`](https://github.com/Materials-Consortia/optimade-python-tools/releases/v0.10.0)+ | [`v1.0.0`](https://github.com/Materials-Consortia/OPTIMADE/blob/v1.0.0/optimade.rst) - [latest](https://github.com/Materials-Consortia/OPTIMADE/blob/master/optimade.rst) |
| [`v1`](https://github.com/Materials-Consortia/optimade-validator-action/releases/tag/v1.2.0) | [`v0.7.0`](https://github.com/Materials-Consortia/optimade-python-tools/releases/v0.7.0) - [`v0.9.8`](https://github.com/Materials-Consortia/optimade-python-tools/releases/v0.9.8) | [`v0.10.0`](https://github.com/Materials-Consortia/OPTIMADE/blob/v0.10.0/optimade.md) - [`v1.0.0-rc2`](https://github.com/Materials-Consortia/OPTIMADE/blob/v1.0.0-rc2/optimade.rst) |
2 changes: 1 addition & 1 deletion tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bats/bats:1.2.1
FROM bats/bats:v1.4.1

RUN echo "**** Installing Python 3 ****" && \
apk add --no-cache python3 && \
Expand Down
19 changes: 6 additions & 13 deletions tests/test_all_versioned_paths.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ load 'test_fixtures'
run ${ENTRYPOINT_SH}
refute_output --partial "ERROR"

OPTIMADE_VERSION=("v1.0" "v1.0.1")
OPTIMADE_VERSION=("v1.1" "v1.1.0")
run cat ${DOCKER_BATS_WORKDIR}/.entrypoint-run_validator.txt
assert_output "run_validator: ${TEST_MAJOR_RUN_VALIDATOR}
run_validator: ${TEST_BASE_RUN_VALIDATOR}${OPTIMADE_VERSION[0]}
Expand All @@ -28,7 +28,7 @@ run_validator: ${TEST_BASE_RUN_VALIDATOR}${OPTIMADE_VERSION[1]}"
run ${ENTRYPOINT_SH}
refute_output --partial "ERROR"

OPTIMADE_VERSION=("v1.0" "v1.0.1")
OPTIMADE_VERSION=("v1.1" "v1.1.0")
run cat ${DOCKER_BATS_WORKDIR}/.entrypoint-run_validator.txt
assert_output "run_validator: ${TEST_BASE_RUN_VALIDATOR}
run_validator: ${TEST_MAJOR_RUN_VALIDATOR}
Expand All @@ -49,21 +49,14 @@ run_validator: ${TEST_BASE_RUN_VALIDATOR}${OPTIMADE_VERSION[1]}"
}

@test "all versioned paths=True for old spec v0.10.1" {
# Unfortunately, we cannot test the correct parsing of `__api_version__`,
# since we do not support OPTIMADE Python tools versions < 0.10.0.
# The change from __api_version__ 1.0.0-rc1 to 1.0.0 happened for version 0.9.7.
# This test will be kept here to be implemented later when/if the OPTIMADE API
# specification moves to a version > 1.0.0 (as long as it's still supported).
skip "Update when specification version > 1.0.0 is released and used in OPTIMADE Python tools."
# Use OPTIMADE Python tools commit immediately prior to updating to
# OPTIMADE specification v1.0.0-rc2.
# The supported OPTIMADE specification version prior to v1.0.0-rc2 was v0.10.1.
# Use OPTIMADE Python tools v0.15.5 with OPTIMADE API v1.0.1.
# In v0.16.0 the OPTIMADE API was updated to v1.1.0.
export INPUT_ALL_VERSIONED_PATHS=True
export INPUT_VALIDATOR_VERSION=ad68951fc6089402392c6299e8206d19a570d060
export INPUT_VALIDATOR_VERSION=v0.15.5
run ${ENTRYPOINT_SH}
refute_output --partial "ERROR"

OPTIMADE_VERSION=("v0" "v0.10" "v0.10.1")
OPTIMADE_VERSION=("v1" "v1.0" "v1.0.1")
run cat ${DOCKER_BATS_WORKDIR}/.entrypoint-run_validator.txt
assert_output "run_validator: ${TEST_BASE_RUN_VALIDATOR}${OPTIMADE_VERSION[0]}
run_validator: ${TEST_BASE_RUN_VALIDATOR}${OPTIMADE_VERSION[1]}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_as_type.bats
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ load 'test_fixtures'
@test "as type='non_valid_inputs' (invalid value, should fail with status 1 and message)" {
INVALID_AS_TYPE_VALUE=non_valid_inputs
export INPUT_AS_TYPE=${INVALID_AS_TYPE_VALUE}
export INPUT_PATH=${INPUT_PATH}v1.0/${INVALID_AS_TYPE_VALUE}
export INPUT_PATH=${INPUT_PATH}v1.1/${INVALID_AS_TYPE_VALUE}
# Don't use real entrypoint.sh here, since the error code comes from running the validator.
run ${ENTRYPOINT_SH}
assert_output --partial "Validating as type: ${INVALID_AS_TYPE_VALUE}"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_unversioned_path.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ load 'test_fixtures'
run ${ENTRYPOINT_SH}
refute_output --partial "ERROR"

OPTIMADE_VERSION=("v1.0" "v1.0.0")
OPTIMADE_VERSION=("v1.1" "v1.1.0")
run cat ${DOCKER_BATS_WORKDIR}/.entrypoint-run_validator.txt
assert_output "run_validator: ${TEST_BASE_RUN_VALIDATOR}
run_validator: ${TEST_MAJOR_RUN_VALIDATOR}"
Expand Down

0 comments on commit ca41f89

Please sign in to comment.