Skip to content

Commit

Permalink
Merge pull request #8 from litentry/add-integration-test-case
Browse files Browse the repository at this point in the history
P-1111 Adding integration-tests in DA
  • Loading branch information
BillyWooo authored Nov 8, 2024
2 parents 34da262 + 6477b69 commit f30628e
Show file tree
Hide file tree
Showing 27 changed files with 1,502 additions and 2,128 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ jobs:
docker pull litentry/identity-cli:latest
docker pull litentry/litentry-chain-aio:latest
- run: docker images --all

- name: Create env file with secrets
run: |
mkdir -p /opt/worker_configs
Expand All @@ -81,12 +79,6 @@ jobs:
echo "GENIIDATA_API_KEY=${{ secrets.GENIIDATA_API_KEY }}" >> /opt/worker_configs/worker_env
echo "MORALIS_API_KEY=${{ secrets.MORALIS_API_KEY }}" >> /opt/worker_configs/worker_env
echo "MAGIC_CRAFT_API_KEY=${{ secrets.MAGIC_CRAFT_API_KEY }}" >> /opt/worker_configs/worker_env
shell: bash

- name: Start parachain-worker
run: |
./scripts/run_parachain_worker.sh
docker ps
- name: Compile contracts
run: |
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ ignition/deployments/chain-31337
# Remix
compiler_config.json
remix-compiler.config.js

# Integration tests
*.env
vc-di-tests/integration-tests/.env.local
4 changes: 2 additions & 2 deletions contracts/mocks/MockHttpGetBool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ contract MockHttpGetBool {
} else if (
Strings.equal(
url,
"https://bop.burve.workers.dev/?address=0x96aEb2216810C624131c51141da612808103d319"
"https://bop.burve.workers.dev/api?address=0x96aEb2216810C624131c51141da612808103d319"
)
) {
value = true;
} else if (
Strings.equal(
url,
"https://bop.burve.workers.dev/?address=0xA9d439F4DED81152DB00CB7CD94A8d908FEF903e"
"https://bop.burve.workers.dev/api?address=0xA9d439F4DED81152DB00CB7CD94A8d908FEF903e"
)
) {
value = false;
Expand Down
2 changes: 1 addition & 1 deletion contracts/platform_user/BOPClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "../libraries/Identities.sol";

library BOPClient {
function talentAsset(string memory account) internal returns (bool, bool) {
string memory url = "https://bop.burve.workers.dev/?address=";
string memory url = "https://bop.burve.workers.dev/api?address=";

url = string(abi.encodePacked(url, account));

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"deploy-contract": "./scripts/run_deploy.sh",
"format": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol' && prettier --write .",
"check-format": "prettier --check --plugin=prettier-plugin-solidity 'contracts/**/*.sol' && prettier --check .",
"test": "npx hardhat test"
"test": "npx hardhat test",
"test-integration": "cd vc-di-tests/integration-tests && pnpm run test assertion_contracts.test.ts"
},
"devDependencies": {
"@litentry/chaindata": "^0.1.1",
Expand Down
11 changes: 11 additions & 0 deletions scripts/run_parachain_worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ function main {
sudo mkdir -p $WORKER_BASEDIR
sudo chown -R 1000:1000 $WORKER_BASEDIR

echo "Listing parachain base directory:"
ls -l $PARACHAIN_BASEDIR
echo "Listing worker base directory:"
ls -l $WORKER_BASEDIR
echo "Listing /opt/litentry directory:"
ls -l /opt/litentry
ls -l /opt/litentry/worker
ls -l /opt/litentry/parachain

echo "Done listing"

restart_parachain_services
parachain_container_id=$(docker ps --filter "name=para-aio" --format "{{.ID}}")
echo "Parachain container ID: $parachain_container_id"
Expand Down
3 changes: 0 additions & 3 deletions vc-di-tests/integration-tests/.env.local

This file was deleted.

15 changes: 10 additions & 5 deletions vc-di-tests/integration-tests/.env.local.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
NODE_ENV = local
WORKER_ENDPOINT = ws://localhost:2000
NODE_ENDPOINT = ws://localhost:9944
BINARY_DIR=../../bin
LITENTRY_CLI_DIR=../../bin/litentry-cli
NODE_ENV=local

TWITTER_AUTH_TOKEN_V2=''
DISCORD_AUTH_TOKEN=''
ACHAINABLE_AUTH_KEY=''
ONEBLOCK_NOTION_KEY=''
NODEREAL_API_KEY=''
GENIIDATA_API_KEY=''
MORALIS_API_KEY=''
MAGIC_CRAFT_API_KEY=''
1 change: 1 addition & 0 deletions vc-di-tests/integration-tests/.env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_ENV=staging
24 changes: 1 addition & 23 deletions vc-di-tests/integration-tests/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,6 @@
**/
"@typescript-eslint/no-explicit-any": ["off"],
"@typescript-eslint/no-non-null-assertion": ["off"],
"@typescript-eslint/no-var-requires": ["off"],

// explanation: https://typescript-eslint.io/rules/naming-convention/
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "typeLike",
"format": ["StrictPascalCase"]
},
{
"selector": "variable",
"modifiers": ["const"],
"format": ["strictCamelCase", "UPPER_CASE"]
},
{
"selector": "function",
"format": ["strictCamelCase", "StrictPascalCase"]
},
{
"selector": "parameter",
"format": ["strictCamelCase"]
}
]
"@typescript-eslint/no-var-requires": ["off"]
}
}
Loading

0 comments on commit f30628e

Please sign in to comment.