Skip to content

Commit 26d8706

Browse files
author
Adrien Maret
authored
Merge pull request #229 from kuzzleio/2.0.0-rc26-proposal
2 parents b1bb140 + 6ae8329 commit 26d8706

File tree

81 files changed

+2012
-3532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2012
-3532
lines changed

.github/actions/functional-test/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ runs:
66
- name: Run functional test
77
shell: bash
88
run: |
9-
npm install
10-
npm run build
9+
npm run docker npm install
10+
npm run docker npm run build
1111
DOCKER_COMMAND="npm run prod" docker-compose up -d
1212
bash features/wait-kuzzle.sh
1313
npm run test:functional

.github/actions/lint/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ runs:
66
- name: Install deps
77
shell: bash
88
run: |
9-
npm ci
10-
npm run test:lint
9+
npm run docker npm ci
10+
npm run test:lint

.github/workflows/pull_request.workflow.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: [pull_request]
55
jobs:
66
lint:
77
name: Lint
8-
runs-on: ubuntu-18.04
8+
runs-on: ubuntu-22.04
99
steps:
1010
- name: Install SSH key
1111
uses: shimataro/ssh-key-action@v2
@@ -22,7 +22,7 @@ jobs:
2222

2323
functional-tests:
2424
name: Functional Tests
25-
runs-on: ubuntu-18.04
25+
runs-on: ubuntu-22.04
2626
needs: [lint]
2727
steps:
2828
- name: Install SSH key
@@ -38,25 +38,25 @@ jobs:
3838
node-version: "14"
3939
- uses: ./.github/actions/functional-test
4040

41-
doc-dead-links:
42-
name: Check dead-links
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@v2
46-
with:
47-
fetch-depth: 0
48-
- name: Extract references from context
49-
shell: bash
50-
id: extract-refs
51-
run: |
52-
echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)"
53-
echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)"
54-
echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)"
55-
- uses: convictional/trigger-workflow-and-wait@v1.3.0
56-
with:
57-
owner: kuzzleio
58-
repo: documentation
59-
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
60-
workflow_file_name: dead_links.workflow.yml
61-
ref: ${{ steps.extract-refs.outputs.fw-branch }}
62-
inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}'
41+
# doc-dead-links:
42+
# name: Check dead-links
43+
# runs-on: ubuntu-latest
44+
# steps:
45+
# - uses: actions/checkout@v2
46+
# with:
47+
# fetch-depth: 0
48+
# - name: Extract references from context
49+
# shell: bash
50+
# id: extract-refs
51+
# run: |
52+
# echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)"
53+
# echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)"
54+
# echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)"
55+
# - uses: convictional/trigger-workflow-and-wait@v1.3.0
56+
# with:
57+
# owner: kuzzleio
58+
# repo: documentation
59+
# github_token: ${{ secrets.ACCESS_TOKEN_CI }}
60+
# workflow_file_name: dead_links.workflow.yml
61+
# ref: ${{ steps.extract-refs.outputs.fw-branch }}
62+
# inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}'

.github/workflows/push_dev.workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
lint:
1111
name: Lint
12-
runs-on: ubuntu-18.04
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- name: Install SSH key
1515
uses: shimataro/ssh-key-action@v2
@@ -26,7 +26,7 @@ jobs:
2626

2727
functional-tests:
2828
name: Functional Tests
29-
runs-on: ubuntu-18.04
29+
runs-on: ubuntu-22.04
3030
needs: [lint]
3131
steps:
3232
- name: Install SSH key

.github/workflows/push_master.workflow.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
lint:
1212
name: Lint
13-
runs-on: ubuntu-18.04
13+
runs-on: ubuntu-22.04
1414
steps:
1515
- name: Install SSH key
1616
uses: shimataro/ssh-key-action@v2
@@ -27,7 +27,7 @@ jobs:
2727

2828
functional-tests:
2929
name: Functional Tests
30-
runs-on: ubuntu-18.04
30+
runs-on: ubuntu-22.04
3131
needs: [lint]
3232
steps:
3333
- uses: actions/checkout@v2
@@ -69,7 +69,7 @@ jobs:
6969

7070
npm-deploy:
7171
name: Publish Package to NPM.js
72-
runs-on: ubuntu-18.04
72+
runs-on: ubuntu-22.04
7373
needs: [functional-tests]
7474
steps:
7575
- name: Install SSH key
@@ -95,7 +95,7 @@ jobs:
9595
${{ runner.os }}-
9696
- uses: actions/setup-node@v1
9797
with:
98-
node-version: "14.x"
98+
node-version: "14"
9999
registry-url: "https://registry.npmjs.org"
100100
- run: npm install
101101
- run: npm run build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ doc/framework
3535
frontmatter-errors.json
3636

3737
.vscode
38+
.idea/

features/AssetCategory.feature

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Feature: AssetCategory
66
| body.name | "smallTruck" |
77
When I successfully execute the action "device-manager/metadata":"create" with args:
88
| engineId | "engine-ayse" |
9-
| body.name | "length" |
9+
| body.name | "length" |
1010
| body.valueType | "integer" |
1111
| body.mandatory | false |
1212
When I successfully execute the action "device-manager/assetCategory":"linkMetadata" with args:
@@ -35,10 +35,10 @@ Feature: AssetCategory
3535
| body.valueType | "integer" |
3636
| body.mandatory | false |
3737
When I successfully execute the action "device-manager/assetCategory":"linkMetadata" with args:
38-
| engineId | "engine-ayse" |
39-
| _id | "strangeTruck" |
38+
| engineId | "engine-ayse" |
39+
| _id | "strangeTruck" |
4040
| metadataId | "volume" |
41-
| body.value | 101 |
41+
| body.value | 101 |
4242
Then The document "engine-ayse":"asset-category":"strangeTruck" content match:
4343
| name | "strangeTruck" |
4444
| assetMetadata[0] | "volume" |
@@ -74,7 +74,6 @@ Feature: AssetCategory
7474
| category | null |
7575
| subCategory | null |
7676

77-
7877
Scenario: Remove an AssetCategory and verify propagation to a linked asset
7978
When I successfully execute the action "device-manager/assetCategory":"create" with args:
8079
| engineId | "engine-ayse" |
@@ -234,10 +233,7 @@ Feature: AssetCategory
234233
| body.model | "M" |
235234
| body.reference | "asset_03" |
236235
| body.category | "solarTruck" |
237-
When I successfully execute the action "device-manager/asset":"get" with args:
238-
| engineId | "engine-ayse" |
239-
| _id | "solarTruck-M-asset_03" |
240-
Then I should receive a result matching:
236+
Then The formatted document "engine-ayse":"assets":"solarTruck-M-asset_03" content match:
241237
| metadata.panelSurface | 101 |
242238

243239
Scenario: link, update and unlink a metadata on a parent category, and verify edition propagation on children category

features/AssetController.feature

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ Feature: DeviceManager asset controller
1313
| body.model | "ALTMODEL" |
1414
Then The document "engine-kuzzle":"assets":"outils-PERFO-asset_01" content match:
1515
| model | "ALTMODEL" |
16-
When I successfully execute the action "device-manager/asset":"update" with args:
17-
| engineId | "engine-kuzzle" |
16+
When I successfully execute the action "document":"update" with args:
17+
| index | "engine-kuzzle" |
18+
| collection | "assets" |
1819
| _id | "outils-PERFO-asset_01" |
20+
| options.prettify | true |
1921
| body.metadata.foobar | 42 |
2022
| body.metadata.index | "engine-kuzzle" |
2123
| body.model | "PERFO" |
@@ -26,6 +28,12 @@ Feature: DeviceManager asset controller
2628
| model | "PERFO" |
2729
| metadata.foobar | 42 |
2830
| metadata.index | "engine-kuzzle" |
31+
And The document "engine-kuzzle":"assets":"outils-PERFO-asset_01" content match:
32+
| model | "PERFO" |
33+
| metadata[0].key | "foobar" |
34+
| metadata[0].value.integer | 42 |
35+
| metadata[1].key | "index" |
36+
| metadata[1].value.keyword | "engine-kuzzle" |
2937
Then I refresh the collection "engine-kuzzle":"assets"
3038
When I successfully execute the action "device-manager/asset":"search" with args:
3139
| engineId | "engine-kuzzle" |
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Feature: Update device metadata
2+
3+
Scenario: create and update and get a device with dedicated API
4+
When I successfully execute the action "device-manager/device":"create" with args:
5+
| engineId | "device-manager" |
6+
| body.model | "DummyTemp" |
7+
| body.reference | "TOUPDATE" |
8+
Then The document "device-manager":"devices":"DummyTemp-TOUPDATE" exists
9+
When I successfully execute the action "device-manager/device":"update" with args:
10+
| engineId | "device-manager" |
11+
| _id | "DummyTemp-TOUPDATE" |
12+
| body.metadata.hostname | "2004000010" |
13+
And I successfully execute the action "device-manager/device":"get" with args:
14+
| engineId | "device-manager" |
15+
| _id | "DummyTemp-TOUPDATE" |
16+
Then I should receive a result matching:
17+
| model | "DummyTemp" |
18+
| reference | "TOUPDATE" |
19+
| metadata.hostname | "2004000010" |
20+
21+
22+
Scenario: create and update and get a device with standard API
23+
When I successfully execute the action "device-manager/device":"create" with args:
24+
| engineId | "device-manager" |
25+
| body.model | "DummyTemp" |
26+
| body.reference | "TOUPDATE2" |
27+
Then The document "device-manager":"devices":"DummyTemp-TOUPDATE2" exists
28+
When I successfully execute the action "document":"update" with args:
29+
| index | "device-manager" |
30+
| collection | "devices" |
31+
| _id | "DummyTemp-TOUPDATE2" |
32+
| body.metadata | [ { "value": { "keyword": "2004000010" }, "key": "hostname" } ] |
33+
Then The document "device-manager":"devices":"DummyTemp-TOUPDATE2" content match:
34+
| metadata | [ { "value": { "keyword": "2004000010" }, "key": "hostname" } ] |

features/Observer.feature

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Feature: Observer
2+
3+
Scenario: observe an asset document
4+
When I successfully execute the action "device-manager/asset":"create" with args:
5+
| engineId | "engine-ayse" |
6+
| body.type | "truck" |
7+
| body.model | "M" |
8+
| body.reference | "asset_11" |
9+
And I observe document "engine-ayse":"assets":"truck-M-asset_11"
10+
Then I should receive a result matching:
11+
| _source.reference | "asset_11" |
12+
When I successfully execute the action "device-manager/asset":"update" with args:
13+
| engineId | "engine-ayse" |
14+
| _id | "truck-M-asset_11" |
15+
| body.reference | "asset_22" |
16+
Then I should have a realtime object matching:
17+
| _source.reference | "asset_22" |

0 commit comments

Comments
 (0)