Skip to content

Commit

Permalink
Merge pull request #252 from nodlesh/feature/dev-container
Browse files Browse the repository at this point in the history
Dev container for AMTH
  • Loading branch information
nodlesh authored Sep 13, 2024
2 parents 6085587 + 2f160c7 commit f14aa1e
Show file tree
Hide file tree
Showing 11 changed files with 527 additions and 12 deletions.
67 changes: 67 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Mobile Wallet Test Dev",
//"workspaceMount": "source=${localWorkspaceFolder}/aries-mobile-tests,target=/aries-mobile-tests,type=bind",
//"workspaceFolder": "/aries-mobile-tests",
// Use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"build": {
// Path is relative to the devcontainer.json file.
"context": "../aries-mobile-tests",
"dockerfile": "../aries-mobile-tests/Dockerfile.dev-harness"
},
"appPort": ["49160:49160"],

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"docker-from-docker": "latest"
},

// If using a local android device/emulator you will need to mount to the location of the app apk so that it can be installed.
// Change this to your absolute path to the location of the android apk you want to test with
"mounts": [
{ "source": "/Users/Shel/Projects/BC.gov/apps/bc-wallet", "target": "/bc-wallet/app", "type": "bind" },
{ "source": "/Users/Shel/Library/Developer/Xamarin/android-sdk-macosx/emulator/resources","target": "/qrcodes", "type": "bind" }
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [4723, 5037, 8554, 49160],

"initializeCommand": "docker network inspect aath_network >/dev/null 2>&1 || docker network create aath_network",

"runArgs": [
"--network=aath_network",
"--name=amth_test_dev"
],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip install --upgrade pip && \
// pip install --no-cache-dir aiohttp behave allure-behave python-decouple",
"postCreateCommand": "pip install --upgrade pip && \
pip install -r aries-mobile-tests/requirements.txt && \
pip install --no-cache-dir python-decouple && \
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \
sudo apt-get install -y nodejs && \
npm install -g appium && \
appium driver install uiautomator2",

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {
"extensions.verifySignature": false
},
"extensions": [
"ms-python.python",
"ms-python.debugpy",
"ms-python.vscode-pylance",
"alexkrechik.cucumberautocomplete",
"zainchen.json"
]
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ __pycache__
.logs
.build
*.log
.vscode/
all_steps.py
aries-mobile-tests/features/steps/all_steps.py
aries-mobile-tests/allure/allure-results/environment.properties
Expand Down
188 changes: 188 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "Python: Behave current file",
"type": "debugpy",
"request": "launch",
"module": "behave",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/aries-mobile-tests",
"env": {
"SAUCE_USERNAME": "",
"SAUCE_ACCESS_KEY": "",
"SL_REGION": "us-west-1",
"DEVICE_CLOUD": "SauceLabs"
},
"args": [
"${file}",
"--tags=@T002-Proof",
"-k",
"-D",
"Issuer=AATH;http://acme_agent:9020",
"-D",
"Verifier=AATH;http://bob_agent:9030"
]
},
{
"name": "Python: Behave current file LocalAndroid",
"type": "debugpy",
"request": "launch",
"module": "behave",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/aries-mobile-tests",
"env": {
"SAUCE_USERNAME": "",
"SAUCE_ACCESS_KEY": "",
"SL_REGION": "us-west-1",
"DEVICE_CLOUD": "LocalAndroid"
},
"args": [
"${file}",
"--tags=@T002-Proof",
"-k",
"-D",
"Issuer=AATH;http://host.docker.internal:9020",
"-D",
"Verifier=AATH;http://host.docker.internal:9030"
]
},
{
"name": "Python: Behave current file Sauce Labs non-AATH Agents",
"type": "debugpy",
"request": "launch",
"module": "behave",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/aries-mobile-tests",
"env": {
"SAUCE_USERNAME": "",
"SAUCE_ACCESS_KEY": "",
"SL_REGION": "us-west-1",
"DEVICE_CLOUD": "SauceLabs",
"TEST_RETRY_ATTEMPTS_OVERRIDE": "1"
},
"args": [
"${file}",
"--tags=@T009-Proof",
"-k",
"-D",
"Issuer=CANdy_UVP;https://openvp-candy-issuer-test.apps.silver.devops.gov.bc.ca/",
"-D",
"Verifier=PCFT_Chat;https://pctftest-test.vonx.io/"
]
},
{
"name": "Python: Behave current file Sauce Labs Connectionless",
"type": "debugpy",
"request": "launch",
"module": "behave",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/aries-mobile-tests",
"env": {
"SAUCE_USERNAME": "",
"SAUCE_ACCESS_KEY": "",
"SL_REGION": "us-west-1",
"DEVICE_CLOUD": "SauceLabs",
"TEST_RETRY_ATTEMPTS_OVERRIDE": "1"
},
"args": [
"${file}",
"[email protected]",
"-k",
"-D",
"Issuer=CANdy_UVP;https://openvp-candy-issuer-test.apps.silver.devops.gov.bc.ca/",
"-D",
"Verifier=AATH;http://bob_agent:9030"
]
},
{
"name": "Python: Behave current file Sauce Labs BCSC",
"type": "debugpy",
"request": "launch",
"module": "behave",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/aries-mobile-tests",
"env": {
"SAUCE_USERNAME": "",
"SAUCE_ACCESS_KEY": "",
"SL_REGION": "us-west-1",
"DEVICE_CLOUD": "SauceLabs",
"BC_VP_USERNAME": "",
"BC_VP_PASSWORD": "",
"BC_VP_HOLDER_EMAIL": "",
"BC_VP_HOLDER_EMAIL_PASSWORD": "",
"BCSC_ACCOUNT_USER": "",
"BCSC_ACCOUNT_PASSWORD": "",
"GOOGLE_API_TOKEN": "",
"GOOGLE_API_CREDENTIALS": ""
},
"args": [
"${file}",
"--tags=@T001-BCSC",
"-k",
"-D",
"Issuer=BC_VP;https://bcvcpilot-issuer-admin-test.apps.silver.devops.gov.bc.ca",
"-D",
"Verifier=BC_Person_Showcase;https://bc-wallet-demo-agent-admin-test.apps.silver.devops.gov.bc.ca"
]
},
{
"name": "Python: Behave current file Mobile Verifier",
"type": "debugpy",
"request": "launch",
"module": "behave",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/aries-mobile-tests",
"env": {
"SAUCE_USERNAME": "",
"SAUCE_ACCESS_KEY": "",
"SL_REGION": "us-west-1",
"DEVICE_CLOUD": "SauceLabs"
},
"args": [
"${file}",
"[email protected]",
"-k",
"-D",
"Issuer=CANdy_UVP;https://openvp-candy-issuer-test.apps.silver.devops.gov.bc.ca/",
"-D",
"Holder=AATH;http://bob_agent:9030"
]
},
{
"name": "Python: Behave current file Sauce Labs BC Showcase",
"type": "debugpy",
"request": "launch",
"module": "behave",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/aries-mobile-tests",
"env": {
"SAUCE_USERNAME": "",
"SAUCE_ACCESS_KEY": "",
"SL_REGION": "us-west-1",
"DEVICE_CLOUD": "SauceLabs",
"TEST_RETRY_ATTEMPTS_OVERRIDE": "1"
},
"args": [
"${file}",
"--tags=@T002-BCShowcase",
"-k",
"-D",
"Issuer=BCShowcaseIssuer;https://bc-wallet-demo.apps.silver.devops.gov.bc.ca/",
"-D",
"Verifier=BCShowcaseVerifier;https://bc-wallet-demo.apps.silver.devops.gov.bc.ca/"
]
},
]
}
47 changes: 47 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Start Aries Agents",
"type": "shell",
"command": "cd ~/Projects/BC.gov/aries-agent-test-harness && LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io TAILS_SERVER_URL_CONFIG=https://tails.vonx.io AGENT_CONFIG_FILE=/aries-backchannels/acapy/auto_issuer_config.yaml ./manage start -a acapy-main -b acapy-main -n"
},
{
"label": "Stop Aries Agents",
"type": "shell",
"command": "cd ~/Projects/BC.gov/aries-agent-test-harness && ./manage stop"
},
{
"label": "Start Appium Server in Dev Container",
"type": "shell",
"command": "appium --base-path /wd/hub --allow-cors",
"isBackground": true,
"problemMatcher": {
"owner": "custom",
"pattern": {
"regexp": ".*"
},
"background": {
"activeOnStart": true,
"beginsPattern": "^\\[Appium\\] Welcome to Appium v.*",
"endsPattern": "^\\[Appium\\] Appium REST http interface listener started on 0.0.0.0:4723"
}
},
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Stop Appium Server",
"type": "shell",
"command": "pkill -2 -f appium",
"presentation": {
"reveal": "always",
"panel": "new"
}
}
]
}
Loading

0 comments on commit f14aa1e

Please sign in to comment.