Skip to content
Snippets Groups Projects
Commit 05e0b272 authored by Michael Zigldrum's avatar Michael Zigldrum
Browse files

Merge branch trusted-content-resolver:main into main

parents 5dbd8ad7 03f7b061
No related branches found
No related tags found
No related merge requests found
Showing
with 667 additions and 18 deletions
# ansible-playbook ansible.playbook.yml --connection=local -i localhost, #--tags=macos # ansible-playbook ansible.playbook.yml --connection=local -i localhost, #--tags=macos --extra-vars "custom_shell_config=.profile.ada.sh"
- name: trusted-content-resolver - name: trusted_content_resolver
hosts: all hosts: all
vars: vars:
custom_shell_config: unknown custom_shell_config: "{{ lookup('ansible.builtin.env', 'CUSTOM_SHELL_CONFIG') }}"
tasks: tasks:
- name: Set _found_shell_config to the first existing file, raising an error if a file is not found - name: Set _found_shell_config to the first existing file, raising an error if a file is not found
ansible.builtin.set_fact: ansible.builtin.set_fact:
...@@ -14,8 +14,17 @@ ...@@ -14,8 +14,17 @@
- "{{ ansible_env.HOME }}/.zshrc" - "{{ ansible_env.HOME }}/.zshrc"
- "{{ ansible_env.HOME }}/.profile" - "{{ ansible_env.HOME }}/.profile"
- "{{ ansible_env.HOME }}/.bashrc" - "{{ ansible_env.HOME }}/.bashrc"
tags:
- java
- go
- js
- py
- include_tasks: './clients/go/ansible.playbook.yml' - include_tasks: './clients/go/ansible.playbook.yml'
tags: ['go']
- include_tasks: './clients/java/ansible.playbook.yml' - include_tasks: './clients/java/ansible.playbook.yml'
tags: ['java']
- include_tasks: './clients/js/ansible.playbook.yml' - include_tasks: './clients/js/ansible.playbook.yml'
tags: ['js']
- include_tasks: './clients/py/ansible.playbook.yml' - include_tasks: './clients/py/ansible.playbook.yml'
tags: ['py']
ansible:
cd ../.. && \
ansible-playbook ansible.playbook.yml --connection=local -i localhost, --tags=golang
.PHONY: test
test:
cd trusted_content_resolver && go test -v ./...
clean:
go clean -modcache
install:
# no need
third-party-txt-file: install
./scripts/THIRD-PARTY.py
\ No newline at end of file
Keel here all useful information for Golang Client
To install golang interpreter see [2], base metal deployment on Mac/Ubuntu.
To set up the project [1] see usage of ``go mod download`` command, mostly targeting people new for Golang.
A good example of the Golang BDD in action can be seen in this video demo [3]
References::
[1] [Golang Environment – GOPATH vs go.mod](https://www.freecodecamp.org/news/golang-environment-gopath-vs-go-mod/)
[2] [ansible.playbook.yml](./ansible.playbook.yml)
[3] [08 - Golang - BDD cucumber tests](https://www.youtube.com/watch?v=vfTCXWyC8kc)
# Licenses generated through https://pkg.go.dev/ API
module name,license
github.com/cpuguy83/go-md2man/v2,MIT
github.com/cucumber/gherkin/go/v26,MIT
github.com/cucumber/godog,MIT
github.com/cucumber/messages/go/v21,MIT
github.com/cucumber/messages/go/v22,MIT
github.com/davecgh/go-spew,ISC
github.com/gofrs/uuid,MIT
github.com/hashicorp/go-immutable-radix,MPL-2.0
github.com/hashicorp/go-memdb,MPL-2.0
github.com/hashicorp/go-uuid,MPL-2.0
github.com/hashicorp/golang-lru,MPL-2.0
github.com/inconshreveable/mousetrap,Apache-2.0
github.com/kr/pretty,MIT
github.com/kr/pty,MIT
github.com/kr/text,MIT
github.com/pmezard/go-difflib,BSD-3-Clause
github.com/russross/blackfriday/v2,BSD-2-Clause
github.com/spf13/cobra,Apache-2.0
github.com/spf13/pflag,BSD-3-Clause
github.com/stretchr/objx,MIT
github.com/stretchr/testify,MIT
gopkg.in/check.v1,BSD-2-Clause
gopkg.in/yaml.v3,"Apache-2.0, MIT"
# todo make it work with gvm - name: Install go MacOSX
- name: Install Go on MacOSX
homebrew: homebrew:
name: '{{ item }}' name: '{{ item }}'
state: present state: present
...@@ -8,8 +7,9 @@ ...@@ -8,8 +7,9 @@
when: ansible_distribution == 'MacOSX' when: ansible_distribution == 'MacOSX'
tags: tags:
- MacOSX - MacOSX
- golang
- name: Install Go on Ubuntu - name: Install go Ubuntu
apt: apt:
name: '{{ item }}' name: '{{ item }}'
state: present state: present
...@@ -17,4 +17,42 @@ ...@@ -17,4 +17,42 @@
- golang-go - golang-go
when: ansible_distribution == 'Ubuntu' when: ansible_distribution == 'Ubuntu'
tags: tags:
- Ubuntu - MacOSX
- golang
# gvm require to have at least one version installed already
# this is why above pre-installation is required
- name: Install Gvm
ansible.builtin.git:
repo: "https://github.com/moovweb/gvm"
dest: "{{ ansible_env.HOME }}/.gvm"
tags:
- golang
- name: Add Gvm to shell config file
lineinfile:
dest: "{{ _found_shell_config_file }}"
state: present
line: "{{ item }}"
with_items:
- 'export PATH="${HOME}/.gvm/bin:$PATH"'
- 'export GVM_ROOT="${HOME}/.gvm"'
- 'source ${GVM_ROOT}/scripts/gvm-default'
tags:
- golang
- name: Install concrete version for Go
environment:
PATH: "{{ ansible_env.HOME }}/.gvm/bin:{{ ansible_env.PATH }}"
GVM_ROOT: "{{ ansible_env.HOME }}/.gvm"
ansible.builtin.shell: |
source $GVM_ROOT/scripts/gvm-default
gvm install go1.21
gvm use go1.21 --default
cd ./clients/go
go get github.com/cucumber/godog
args:
executable: /bin/bash
tags:
- golang
#!/usr/bin/env python3
# TODO to convert this script in GO.
from pathlib import Path
import csv
import http.client # important, do not replace with request, keep script portable
import re
CURRENT_DIR = Path(__file__).parent
GO_SUM_FILE = CURRENT_DIR / '../trusted_content_resolver/go.sum'
THIRD_PARTY_OUTPUT_FILE = CURRENT_DIR / '../THIRD-PARTY.txt'
def detect_licenses() -> None:
unique = set()
lines = GO_SUM_FILE.read_text().splitlines()
with THIRD_PARTY_OUTPUT_FILE.open('w', newline='') as write_file:
writer = csv.writer(write_file)
# headers
writer.writerow(['# Licenses generated through https://pkg.go.dev/ API'])
writer.writerow(["module name", "license"])
conn = http.client.HTTPSConnection('pkg.go.dev')
# "module name","license"
for line in lines:
split = line.split()
url = split[0]
if url not in unique:
unique.add(url)
else:
continue
print(f'requesting https://pkg.go.dev/{url}?tab=licenses...')
conn.request("GET", f'/{url}?tab=licenses')
response = conn.getresponse()
content = response.read().decode()
match = re.search('<div id="#lic-0">(.+?)</div>', content)
license_name = match.group(1) if match else 'unknown'
writer.writerow([url, license_name])
if __name__ == '__main__':
detect_licenses()
module trusted_content_resolver
go 1.21
require github.com/cucumber/godog v0.13.0
require (
github.com/cucumber/gherkin/go/v26 v26.2.0 // indirect
github.com/cucumber/messages/go/v21 v21.0.1 // indirect
github.com/gofrs/uuid v4.3.1+incompatible // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-memdb v1.3.4 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/spf13/pflag v1.0.5 // indirect
)
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cucumber/gherkin/go/v26 v26.2.0 h1:EgIjePLWiPeslwIWmNQ3XHcypPsWAHoMCz/YEBKP4GI=
github.com/cucumber/gherkin/go/v26 v26.2.0/go.mod h1:t2GAPnB8maCT4lkHL99BDCVNzCh1d7dBhCLt150Nr/0=
github.com/cucumber/godog v0.13.0 h1:KvX9kNWmAJwp882HmObGOyBbNUP5SXQ+SDLNajsuV7A=
github.com/cucumber/godog v0.13.0/go.mod h1:FX3rzIDybWABU4kuIXLZ/qtqEe1Ac5RdXmqvACJOces=
github.com/cucumber/messages/go/v21 v21.0.1 h1:wzA0LxwjlWQYZd32VTlAVDTkW6inOFmSM+RuOwHZiMI=
github.com/cucumber/messages/go/v21 v21.0.1/go.mod h1:zheH/2HS9JLVFukdrsPWoPdmUtmYQAQPLk7w5vWsk5s=
github.com/cucumber/messages/go/v22 v22.0.0/go.mod h1:aZipXTKc0JnjCsXrJnuZpWhtay93k7Rn3Dee7iyPJjs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI=
github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-memdb v1.3.4 h1:XSL3NR682X/cVk2IeV0d70N4DZ9ljI885xAEU8IoK3c=
github.com/hashicorp/go-memdb v1.3.4/go.mod h1:uBTr1oQbtuMgd1SSGoR8YV27eT3sBHbYiNm53bMpgSg=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
package trusted_content_resolver
import "fmt"
func main() {
fmt.Println("hello world")
}
package bdd
import (
"testing"
"github.com/cucumber/godog"
)
func actorXGetsVerified() error {
return godog.ErrPending
}
func anActorXToBeVerified() error {
return godog.ErrPending
}
func weHaveXFSCTRAINTrustedContentResolverRESTAPI() error {
return godog.ErrPending
}
func weInitiateAVerificationActorX() error {
return godog.ErrPending
}
func TestFeatures(t *testing.T) {
suite := godog.TestSuite{
ScenarioInitializer: InitializeScenario,
Options: &godog.Options{
Format: "pretty",
Paths: []string{"features"},
TestingT: t, // Testing instance that will run subtests.
},
}
if suite.Run() != 0 {
t.Fatal("non-zero status returned, failed to run feature tests")
}
}
func InitializeScenario(ctx *godog.ScenarioContext) {
ctx.Step(`^actor X gets verified$`, actorXGetsVerified)
ctx.Step(`^an actor X to be verified$`, anActorXToBeVerified)
ctx.Step(`^we have XFSC TRAIN Trusted Content Resolver REST API$`, weHaveXFSCTRAINTrustedContentResolverRESTAPI)
ctx.Step(`^we initiate a verification actor X$`, weInitiateAVerificationActorX)
}
../../../../../features/
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>eu.xfsc.train</groupId>
<artifactId>trusted-content-resolver</artifactId>
<version>1.0.0.local</version>
<relativePath>../../</relativePath>
</parent>
<artifactId>trusted-content-resolver-java-client</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>
<name>trusted-content-resolver-java-client</name>
<description>Eclipse XFSC TRAIN Trust Content Resolver shared Java client</description>
<dependencies>
<dependency>
<groupId>eu.xfsc.train</groupId>
<artifactId>trusted-content-resolver-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
package eu.xfsc.train.tcr.client;
import java.util.Map;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.codec.json.Jackson2JsonDecoder;
import org.springframework.http.codec.json.Jackson2JsonEncoder;
import org.springframework.web.reactive.function.client.WebClient;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import reactor.core.publisher.Mono;
public abstract class ServiceClient {
protected final String baseUrl; // do we need it?
protected final ObjectMapper mapper;
protected final WebClient client;
public ServiceClient(String baseUrl, String jwt) {
this.baseUrl = baseUrl;
mapper = new ObjectMapper()
.findAndRegisterModules() // .registerModule(new ParanamerModule()) .registerModule(new JavaTimeModule())
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
this.client = WebClient.builder()
//.apply(oauth2Client.oauth2Configuration())
//.filter(new ServerOAuth2AuthorizedClientExchangeFilterFunction(authorizedClientManager))
.baseUrl(baseUrl)
.codecs(configurer -> {
configurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper, MediaType.APPLICATION_JSON));
configurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper, MediaType.APPLICATION_JSON));
})
.defaultHeader(HttpHeaders.AUTHORIZATION, "Bearer " + jwt)
.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.build();
// this.template.setErrorHandler(new ErrorHandler(mapper));
}
public ServiceClient(String baseUrl, WebClient client) {
this.baseUrl = baseUrl;
this.client = client;
this.mapper = new ObjectMapper()
.findAndRegisterModules() // .registerModule(new ParanamerModule()) .registerModule(new JavaTimeModule())
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
}
public String getUrl() {
return this.baseUrl;
}
protected <T> T doGet(String path, Map<String, Object> params, Class<T> reType) {
return client
.get()
.uri(path, builder -> builder.build(params))
.retrieve()
.bodyToMono(reType)
.block();
}
// TODO: add asynch methods also
protected <T> T doPost(String path, Object body, Map<String, Object> params, Class<T> reType) {
return client
.post()
.uri(path, builder -> builder.build(params))
.bodyValue(body)
.retrieve()
.bodyToMono(reType)
.block();
}
protected <T> T doPost(String path, Map<String, Object> params, Class<T> reType) {
return client
.post()
.uri(path, builder -> builder.build(params))
.retrieve()
.bodyToMono(reType)
.block();
}
protected <T> Mono<T> doPostAsync(String path, Object body, Map<String, Object> params, Class<T> reType) {
return client
.post()
.uri(path, builder -> builder.build(params))
.bodyValue(body)
.retrieve()
.bodyToMono(reType);
}
protected <T> Mono<T> doPostAsync(String path, Map<String, Object> params, Class<T> reType) {
return client
.post()
.uri(path, builder -> builder.build(params))
.retrieve()
.bodyToMono(reType);
}
protected <T> T doPut(String path, Object body, Map<String, Object> params, Class<T> reType) {
return client
.put()
.uri(path, builder -> builder.build(params))
.bodyValue(body)
.retrieve()
.bodyToMono(reType)
.block();
}
protected <T> T doDelete(String path, Map<String, Object> params, Class<T> reType) {
return client
.delete()
.uri(path, builder -> builder.build(params))
.retrieve()
.bodyToMono(reType)
.block();
}
}
package eu.xfsc.train.tcr.client;
import java.util.Map;
import org.springframework.web.reactive.function.client.WebClient;
import eu.xfsc.train.tcr.api.generated.model.VerificationRequest;
import eu.xfsc.train.tcr.api.generated.model.VerificationResult;
public class VerificationClient extends ServiceClient {
public VerificationClient(String baseUrl, String jwt) {
super(baseUrl, jwt);
}
public VerificationClient(String baseUrl, WebClient client) {
super(baseUrl, client);
}
public VerificationResult resolveIssuer(String issuer, String pointer) {
VerificationRequest vrq = new VerificationRequest();
vrq = vrq.issuer(issuer).trustSchemePointer(pointer);
return doPost(baseUrl + "/resolve", vrq, Map.of(), VerificationResult.class);
}
}
ansible:
cd ../.. && \
ansible-playbook ansible.playbook.yml --connection=local -i localhost, --tags=npm
npm_version:
which npm
@npm --version
./node_modules:
npm install
install: npm_version ./node_modules/
test: install
npm test
clean:
rm -rvf "./node_modules/"
third-party-txt-file: install
echo '# Licenses generated through npm License checker (BDS-3-Clause)' > ./THIRD-PARTY.txt
./node_modules/.bin/license-checker --unkown --csv >> ./THIRD-PARTY.txt
# JS/TypeScript implementation for BDD tests and clients
Credits to https://www.elliotdenolf.com/blog/cucumberjs-with-typescript.
## How to Run
### Steps
- `git clone` repo, `cd` into directory
- make test # look also for all available commands in Makefile
- make install # install only once
- make install --always-make # force install
This diff is collapsed.
...@@ -4,14 +4,20 @@ ...@@ -4,14 +4,20 @@
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
args: args:
creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh" creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh"
tags:
- npm
- name: add nvm to bash config file - name: add nvm to bash config file
lineinfile: lineinfile:
dest: "{{ _found_shell_config_file }}" dest: "{{ _found_shell_config_file }}"
state: present state: present
line: "source {{ ansible_env.HOME }}/.nvm/nvm.sh" line: "source {{ ansible_env.HOME }}/.nvm/nvm.sh"
tags:
- npm
- name: Install concrete version for Node - name: Install concrete version for Node
ansible.builtin.shell: | ansible.builtin.shell: |
source {{ ansible_env.HOME }}/.nvm/nvm.sh source {{ ansible_env.HOME }}/.nvm/nvm.sh
nvm install v20.8.0 nvm install v20.8.0
tags:
- npm
\ No newline at end of file
# TODO transfer config cucumber.js into config/cucumber.yaml
default:
paths:
- 'features/**/*.feature'
require-module:
- 'ts-node/register'
require:
- 'step-definitions/**/*.ts'
format:
- "html:cucumber-report.html"
- 'progress-bar'
- 'node_modules/cucumber-pretty'
// TODO transfer config cucumber.js into config/cucumber.yaml
let common = [
'../../features/**/*.feature',
'--require-module ts-node/register',
'--require ./test/bdd/steps/**/*.ts',
'--format progress-bar',
'--format node_modules/cucumber-pretty',
// '--format html:cucumber-report.html'
].join(' ');
module.exports = {
default: common,
// More profiles can be added if desired
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment