Skip to content

Commit

Permalink
Manage integration tests with GitHub Actions (openwallet-foundation#2952
Browse files Browse the repository at this point in the history
)

Signed-off-by: jamshale <jamiehalebc@gmail.com>
  • Loading branch information
jamshale committed May 27, 2024
1 parent dca3ef7 commit 7214999
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .github/actions/run-integration-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
TEST_SCOPE:
description: "Set of flags that defines the test scope"
required: false
default: "-t @GHA"
default: "-t @PR"
IN_LEDGER_URL:
description: "URL to the von network ledger browser"
required: false
Expand All @@ -27,7 +27,7 @@ runs:
PUBLIC_TAILS_URL: ${{ inputs.IN_PUBLIC_TAILS_URL }}
LOG_LEVEL: warning
NO_TTY: "1"
working-directory: acapy/demo
working-directory: ./demo
branding:
icon: "mic"
color: "purple"
50 changes: 40 additions & 10 deletions .github/workflows/integrationtests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: acapy-integration-tests

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
pull_request:
branches:
Expand All @@ -18,17 +20,45 @@ jobs:
test:
runs-on: ubuntu-latest
if: (github.event_name == 'pull_request' && github.repository == 'hyperledger/aries-cloudagent-python') || (github.event_name != 'pull_request')
outputs:
is_release: ${{ steps.check_if_release.outputs.is_release }}
steps:
- name: checkout-acapy
uses: actions/checkout@v4
with:
path: acapy
#- name: run-von-network
# uses: ./acapy/.github/actions/run-von-network
#- name: run-indy-tails-server
# uses: ./acapy/.github/actions/run-indy-tails-server
- name: run-integration-tests
uses: ./acapy/.github/actions/run-integration-tests
# to run with a specific set of tests include the following parameter:
# with:
# TEST_SCOPE: "-t @T001-RFC0037"
fetch-depth: 0
- name: Check if PR is a release
id: check_if_release
continue-on-error: true
run: |
echo git remote -v
git remote add upstream https://github.com/hyperledger/aries-cloudagent-python.git
git fetch upstream
last_merge=$(git rev-list --no-merges -n 1 upstream/main)
echo event = ${{ github.event_name }}
echo "$last_merge"
echo "${{ github.sha }}"
echo Will exit with code 1 if the pull request is not a release
changes=$(git diff "${{ github.sha }}" "$last_merge" pyproject.toml)
version=$(echo "$changes" | grep -A1 'name = "aries_cloudagent"' | head -n 2 | tail -n 1 | awk '{print $3}' | tr -d '"')
echo "$version"
if [ "$version" ]; then
echo "This is a release because the aries-cloudagent version in pyproject.toml has changes"
echo is_release=true >> $GITHUB_OUTPUT
fi
- name: run-pr-integration-tests
uses: ./.github/actions/run-integration-tests
if: (steps.check_if_release.outputs.is_release != 'true' && github.event_name == 'pull_request')
- name: run-release-or-cron-integration-tests
if: (steps.check_if_release.outputs.is_release == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
uses: ./.github/actions/run-integration-tests
with:
TEST_SCOPE: "-t @Full"
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
echo "Failure: Detected unawaited coroutine warning in pytest output."
exit 1
fi
exit $PYTEST_EXIT_CODE
exit $PYTEST_EXIT_CODE
6 changes: 3 additions & 3 deletions demo/features/0160-connection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: RFC 0160 Aries agent connection functions
Then "Acme" has an active connection
And "Bob" has an active connection

@GHA @UnqualifiedDids
@PR @Full @UnqualifiedDids
Examples:
| Acme_capabilities | Acme_extra | Bob_capabilities | Bob_extra |
| --public-did --did-exchange --emit-did-peer-2 | | --did-exchange --emit-did-peer-2 | |
Expand Down Expand Up @@ -40,7 +40,7 @@ Feature: RFC 0160 Aries agent connection functions
| --did-exchange --emit-did-peer-4 | | --emit-did-peer-4 | |
| --did-exchange --reuse-connections --emit-did-peer-4 | | --reuse-connections --emit-did-peer-4 | |

@GHA @MultiUseConnectionReuse
@PR @Full @MultiUseConnectionReuse
Examples:
| Acme_capabilities | Acme_extra | Bob_capabilities | Bob_extra |
| --did-exchange --multi-use-invitations --emit-did-peer-2 | | --emit-did-peer-2 | |
Expand All @@ -56,7 +56,7 @@ Feature: RFC 0160 Aries agent connection functions
| --public-did --did-exchange --multi-use-invitations --emit-did-peer-4 | | --did-exchange --emit-did-peer-2 | |
| --public-did --did-exchange --multi-use-invitations --reuse-connections --emit-did-peer-2 | | --did-exchange --reuse-connections --emit-did-peer-4 | |

@GHA @WalletType_Askar_AnonCreds
@PR @Full @WalletType_Askar_AnonCreds
Examples:
| Acme_capabilities | Acme_extra | Bob_capabilities | Bob_extra |
| --public-did --did-exchange --wallet-type askar-anoncreds --emit-did-peer-2 | | --did-exchange --wallet-type askar-anoncreds --emit-did-peer-2 | |
Expand Down
41 changes: 25 additions & 16 deletions demo/features/0453-issue-credential.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,37 @@ Feature: RFC 0453 Aries agent issue credential
When "Acme" offers a credential with data <Credential_data>
Then "Bob" has the credential issued

@GHA @WalletType_Askar @BasicTest
@Full @WalletType_Askar @BasicTest
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data | Acme_extra | Bob_extra |
| --public-did --did-exchange | --did-exchange | driverslicense | Data_DL_NormalizedValues | | |

@GHA @WalletType_Askar @AltTests
@Full @WalletType_Askar @AltTests
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data | Acme_extra | Bob_extra |
| --public-did | | driverslicense | Data_DL_NormalizedValues | | |
| --public-did --mediation | --mediation | driverslicense | Data_DL_NormalizedValues | | |
| --public-did --multitenant | --multitenant --log-file | driverslicense | Data_DL_NormalizedValues | | |

@GHA @WalletType_Askar_AnonCreds @BasicTest
@Full @WalletType_Askar_AnonCreds @BasicTest
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data | Acme_extra | Bob_extra |
| --public-did --wallet-type askar-anoncreds | --wallet-type askar-anoncreds | driverslicense | Data_DL_NormalizedValues | | |
| --public-did --wallet-type askar-anoncreds --cred-type vc_di | --wallet-type askar-anoncreds | driverslicense | Data_DL_NormalizedValues | | |

@GHA @WalletType_Askar_AnonCreds @AltTests
@Full @WalletType_Askar_AnonCreds @AltTests
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data | Acme_extra | Bob_extra |
| --public-did --wallet-type askar-anoncreds | | driverslicense | Data_DL_NormalizedValues | | |
| --public-did | --wallet-type askar-anoncreds | driverslicense | Data_DL_NormalizedValues | | |

@GHA @WalletType_Askar @ConnectionTests
@PR @Full @WalletType_Askar @ConnectionTests
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data | Acme_extra | Bob_extra |
| --did-exchange --emit-did-peer-4 | --did-exchange --emit-did-peer-4 | driverslicense | Data_DL_NormalizedValues | | |
| --did-exchange --reuse-connections --emit-did-peer-4 | --did-exchange --reuse-connections --emit-did-peer-4 | driverslicense | Data_DL_NormalizedValues | | |

@GHA @WalletType_Askar_AnonCreds @ConnectionTests
@PR @Full @WalletType_Askar_AnonCreds @ConnectionTests
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data | Acme_extra | Bob_extra |
| --did-exchange --wallet-type askar-anoncreds --emit-did-peer-4 | --did-exchange --wallet-type askar-anoncreds --emit-did-peer-4 | driverslicense | Data_DL_NormalizedValues | | |
Expand Down Expand Up @@ -79,7 +79,7 @@ Feature: RFC 0453 Aries agent issue credential
And "Acme" offers and deletes a credential with data <Credential_data>
Then "Bob" has the exchange abandoned

@GHA @WalletType_Askar
@PR @Full @WalletType_Askar
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --public-did | | driverslicense | Data_DL_NormalizedValues |
Expand All @@ -106,7 +106,7 @@ Feature: RFC 0453 Aries agent issue credential
And "Acme" is ready to issue a credential for <Schema_name>
When "Bob" requests a credential with data <Credential_data> from "Acme" it fails

@GHA @WalletType_Askar
@PR @Full @WalletType_Askar
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --public-did | | driverslicense | Data_DL_NormalizedValues |
Expand Down Expand Up @@ -137,7 +137,7 @@ Feature: RFC 0453 Aries agent issue credential
Then "Bob" has the json-ld credential issued
And "Acme" has the exchange completed

@GHA @WalletType_Askar
@PR @Full @WalletType_Askar
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --public-did --cred-type json-ld | | driverslicense | Data_DL_NormalizedValues |
Expand Down Expand Up @@ -166,15 +166,20 @@ Feature: RFC 0453 Aries agent issue credential
When "Acme" offers "Bob" a json-ld credential with data <Credential_data>
Then "Bob" has the json-ld credential issued

@GHA @WalletType_Askar
@PR @Full @WalletType_Askar
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --public-did --cred-type json-ld | | driverslicense | Data_DL_NormalizedValues |

@Full @WalletType_Askar
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --public-did --cred-type json-ld --did-exchange | --did-exchange | driverslicense | Data_DL_NormalizedValues |
| --public-did --cred-type json-ld --mediation | --mediation | driverslicense | Data_DL_NormalizedValues |
| --public-did --cred-type json-ld --multitenant --log-file | --multitenant | driverslicense | Data_DL_NormalizedValues |

@GHA @WalletType_Askar_AnonCreds

@Full @WalletType_Askar_AnonCreds
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --public-did --cred-type json-ld --wallet-type askar-anoncreds | --wallet-type askar-anoncreds | driverslicense | Data_DL_NormalizedValues |
Expand All @@ -199,21 +204,25 @@ Feature: RFC 0453 Aries agent issue credential
When "Bob" requests a json-ld credential with data <Credential_data> from "Acme"
Then "Bob" has the json-ld credential issued

@GHA @WalletType_Askar
@PR @Full @WalletType_Askar
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --public-did --cred-type json-ld | | driverslicense | Data_DL_NormalizedValues |

@Full @WalletType_Askar
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --public-did --cred-type json-ld --did-exchange | --did-exchange | driverslicense | Data_DL_NormalizedValues |
| --public-did --cred-type json-ld --mediation | --mediation | driverslicense | Data_DL_NormalizedValues |
| --public-did --cred-type json-ld --multitenant | --multitenant | driverslicense | Data_DL_NormalizedValues |

@GHA @WalletType_Askar_AnonCreds
@PR @Full @WalletType_Askar_AnonCreds
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --public-did --cred-type json-ld --wallet-type askar-anoncreds | --wallet-type askar-anoncreds | driverslicense | Data_DL_NormalizedValues |


@T004-RFC0453
@T004-RFC0453 @Full
Scenario Outline: Issue a credential with revocation, with the Issuer beginning with an offer, and then revoking the credential
Given we have "2" agents
| name | role | capabilities |
Expand All @@ -224,14 +233,14 @@ Feature: RFC 0453 Aries agent issue credential
Then "Acme" revokes the credential
And "Bob" has the credential issued

@GHA @WalletType_Askar
@Full @WalletType_Askar
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --revocation --public-did | | driverslicense | Data_DL_NormalizedValues |
| --revocation --public-did --did-exchange | --did-exchange | driverslicense | Data_DL_NormalizedValues |
| --revocation --public-did --multitenant | --multitenant | driverslicense | Data_DL_NormalizedValues |

@WalletType_Askar_AnonCreds
@Full @WalletType_Askar_AnonCreds
Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --revocation --public-did --wallet-type askar-anoncreds | --wallet-type askar-anoncreds | driverslicense | Data_DL_NormalizedValues |
Expand Down
Loading

0 comments on commit 7214999

Please sign in to comment.