Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup taf #2

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
41f5748
Setup taf
Jul 4, 2023
c3b6649
Setup taf
Jul 4, 2023
91e6263
Update the pipeline
sitilge Jul 4, 2023
f3ca8ee
Merge pull request #3 from hoprnet/martins
trincema Jul 4, 2023
2f3ac04
Setup taf
Jul 4, 2023
1681162
Setup taf
Jul 4, 2023
598c620
Setup taf
Jul 4, 2023
bd784bb
Setup taf
Jul 4, 2023
ef01cf6
Setup taf
Jul 5, 2023
82943c5
Setup taf
Jul 5, 2023
e884c3a
Setup taf
Jul 5, 2023
b466c48
Update the pipeline, install node
sitilge Jul 5, 2023
0a8a693
Output python version
sitilge Jul 5, 2023
f22c8d2
TAF setup
Jul 5, 2023
9319d30
Pipeline update
sitilge Jul 5, 2023
205c866
Pipeline update
sitilge Jul 5, 2023
1a8e195
Pipeline update
sitilge Jul 5, 2023
5842449
Pipeline update
sitilge Jul 5, 2023
06ecf3b
TAF setup
Jul 5, 2023
322a526
TAF setup
Jul 5, 2023
1a9b09a
Pipeline update
sitilge Jul 5, 2023
51e3411
Pipeline update
sitilge Jul 5, 2023
ad0eef2
Fix the path
sitilge Jul 5, 2023
757b503
TAF setup
Jul 5, 2023
91307db
TAF setup
Jul 5, 2023
09741f1
TAF setup
Jul 5, 2023
edd01de
TAF setup
Jul 5, 2023
9b36c31
TAF setup
Jul 5, 2023
d199e3c
TAF setup
Jul 5, 2023
cde576e
TAF setup
Jul 5, 2023
a022c2c
TAF setup
Jul 5, 2023
5db0e37
TAF setup
Jul 5, 2023
3cfab2f
TAF setup
Jul 5, 2023
5fa5df5
TAF setup
Jul 5, 2023
79d2420
TAF setup
Jul 5, 2023
14d4387
TAF setup
Jul 5, 2023
17b49d3
TAF setup
Jul 6, 2023
e2c2c1c
TAF setup
Jul 6, 2023
eb309ad
TAF setup
Jul 6, 2023
73673d3
TAF setup
Jul 6, 2023
76981cf
TAF setup
Jul 6, 2023
bfc674c
TAF setup
Jul 6, 2023
39333bb
TAF setup
Jul 6, 2023
13bb815
TAF setup
Jul 6, 2023
3d37a4b
TAF setup
Jul 6, 2023
93c8ed2
TAF setup
Jul 6, 2023
0f89de7
TAF setup
Jul 6, 2023
b7e88f0
TAF setup
Jul 6, 2023
3857ada
TAF setup
Jul 6, 2023
8c6fde0
TAF setup
Jul 7, 2023
c2acf5a
TAF setup
Jul 7, 2023
fe6aeb1
TAF setup
Jul 7, 2023
6496b6f
TAF setup
Jul 7, 2023
ee51ea1
TAF setup
Jul 7, 2023
363d9bd
TAF setup
Jul 7, 2023
179b8da
TAF setup
Jul 9, 2023
44380ba
TAF setup
Jul 9, 2023
43cb97a
TAF setup
Jul 10, 2023
c2a44d5
Update main.yaml
ausias-armesto Jul 10, 2023
3febc0f
TAF setup
Jul 10, 2023
37af1c3
TAF setup
Jul 10, 2023
f30ddce
TAF setup
Jul 10, 2023
08d8c62
Temporary commit
ausias-armesto Sep 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
81 changes: 81 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Test

on:
push:
branches: [ "**" ]

defaults:
run:
shell: bash

jobs:
setup-and-test:
#timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout hoprnet
with:
path: "hoprnet"
repository: "hoprnet/hoprnet"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "16"
#- working-directory: "hoprnet/packages/hoprd"
# name: Install Hoprd
# uses: borales/actions-yarn@v4
# with:
# cmd: yarn clean && yarn build:wasm && tsc -p . && chmod u+x lib/*.js
- working-directory: "hoprnet/packages/hopli"
name: Install Hopli
run: |
cargo build --release && cargo install --path . && echo $PATH:$PWD/.cargo/bin >> $GITHUB_PATH
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: Install Nix
uses: cachix/install-nix-action@v20
- name: Install dependencies
run: |
cd hoprnet
nix develop -c make -j deps-ci
- name: Build hoprd
run: |
cd hoprnet
nix develop -c make -j build

- name: Show versions
run: |
python --version
node --version
hopli --version
forge --version
anvil --version
cast --version
chisel --version
ls /home/runner/work/hopraf/hopraf/hoprnet/packages/hoprd/
- uses: actions/checkout@v3
name: Checkout hopraf
with:
path: "hopraf"
- name: Install dependencies
working-directory: hopraf
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
continue-on-error: true
- name: Run tests
uses: onichandame/python-test-action@master
with:
deps_list: 'hopraf/requirements.txt'
- name: Run integration tests
working-directory: hopraf
run: pytest -v src/test_plans/integration/test_api.py
81 changes: 81 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Test

on:
push:
branches: [ "**" ]

defaults:
run:
shell: bash

jobs:
setup-and-test:
#timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout hoprnet
with:
path: "hoprnet"
repository: "hoprnet/hoprnet"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "16"
#- working-directory: "hoprnet/packages/hoprd"
# name: Install Hoprd
# uses: borales/actions-yarn@v4
# with:
# cmd: yarn clean && yarn build:wasm && tsc -p . && chmod u+x lib/*.js
- working-directory: "hoprnet/packages/hopli"
name: Install Hopli
run: |
cargo build --release && cargo install --path . && echo $PATH:$PWD/.cargo/bin >> $GITHUB_PATH
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: Install Nix
uses: cachix/install-nix-action@v20
- name: Install dependencies
run: |
cd hoprnet
nix develop -c make -j deps-ci
- name: Build hoprd
run: |
cd hoprnet
nix develop -c make -j build

- name: Show versions
run: |
python --version
node --version
hopli --version
forge --version
anvil --version
cast --version
chisel --version
ls /home/runner/work/hopraf/hopraf/hoprnet/packages/hoprd/
- uses: actions/checkout@v3
name: Checkout hopraf
with:
path: "hopraf"
- name: Install dependencies
working-directory: hopraf
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
continue-on-error: true
- name: Run tests
uses: onichandame/python-test-action@master
with:
deps_list: 'hopraf/requirements.txt'
- name: Run integration tests
working-directory: hopraf
run: pytest -v src/test_plans/integration/test_api.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@


.POSIX:

all: help

.PHONY: install
install:
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
docker pull europe-west3-docker.pkg.dev/hoprassociation/docker-images/hopr-pluto:latest

.PHONY: pluto-start
pluto-start:
docker-compose up 2&>1 > /dev/null &

.PHONY: pluto-stop
pluto-stop:
docker-compose down

.PHONY: test
test:
pytest -v src/test_plans/integration/test_api.py

.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# hopraf
# hopraf
TAF/TAS = Test Automation Framework/Test Automation Solution

# Local Setup
- `pip install -r requirements.txt`
54 changes: 54 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
version: '3.8'

services:
pluto:
image: europe-west3-docker.pkg.dev/hoprassociation/docker-images/hopr-pluto:2.0.0-alpha-pr.5219
container_name: pluto
hostname: pluto
ports:
- 8545:8545
- 13301:13301
- 13302:13302
- 13303:13303
- 13304:13304
- 13305:13305
- 19091:19091
- 19092:19092
- 19093:19093
- 19094:19094
- 19095:19095
- 18081:18081
- 18082:18082
- 18083:18083
- 18084:18084
- 18085:18085
# extra_hosts:
# - 'host.docker.internal:host-gateway'
# deploy:
# resources:
# limits:
# memory: 256M
# privileged: true
volumes:
- /tmp/pluto:/tmp
expose:
- 8545
- 13301
- 13302
- 13303
- 13304
- 13305
- 19091
- 19092
- 19093
- 19094
- 19095
- 18081
- 18082
- 18083
- 18084
- 18085
environment:
- DEBUG=hopr*
- NODE_OPTIONS="--experimental-wasm-modules --experimental-wasm-reftypes"
10 changes: 10 additions & 0 deletions lib/api/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { default as Hopr } from '@hoprnet/hopr-core';
import type { LogStream } from '../logs.js';
import type { StateOps } from '../types.js';
export default function setupAPI(node: Hopr, logs: LogStream, stateOps: StateOps, options: {
disableApiAuthentication: boolean;
apiHost: string;
apiPort: number;
apiToken?: string;
}): () => void;
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions lib/api/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions lib/api/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/api/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions lib/api/token.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { HoprDB } from '@hoprnet/hopr-utils';
declare enum LimitType {
calls = 0
}
export type LimitTypeString = keyof typeof LimitType;
export type Limit = {
type: LimitTypeString;
conditions: {
max?: number;
};
used?: number;
};
export type Capability = {
endpoint: string;
limits?: Array<Limit>;
};
export type Token = {
id: string;
capabilities: Array<Capability>;
description?: string;
valid_until?: number;
};
export declare function authenticateToken(db: HoprDB, id: string): Promise<Token>;
export declare function authorizeToken(db: HoprDB, token: Token, endpointRef: string): Promise<boolean>;
export declare function createToken(db: HoprDB, tokenScope: Token, capabilities: Array<Capability>, description?: string, lifetime?: number): Promise<Token>;
export declare function storeToken(db: HoprDB, token: Token): Promise<void>;
export declare function deleteToken(db: HoprDB, id: string): Promise<void>;
export declare function validateTokenCapabilities(capabilities: Array<Capability>): boolean;
export declare function validateScopedTokenCapabilities(scopeCapabilities: Array<Capability>, capabilities: Array<Capability>): boolean;
export declare function validateScopedTokenLifetime(scopeValidUntil: number, validUntil: number): boolean;
export {};
//# sourceMappingURL=token.d.ts.map
1 change: 1 addition & 0 deletions lib/api/token.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading