Tests fail if RPS server isn't localhost
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- angular, typescript
調査の方向性
src/app/shared/deactivate-device/deactivate-device.component.spec.ts から始め、ハードコードされた localhost の期待値を src/environments/environment.ts と比較します。リモート RPS サーバー構成を使用してテストを実行します。localhost を前提とせずに無効化 URL のテストがパスすれば完了です。
索引モデルが issue の本文から書いたものです。
説明
To Reproduce 🪜
Steps to reproduce the behavior:
Change the environment to use a remote RPS server, for example:
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 63d436c..7904a38 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -9,9 +9,9 @@
export const environment = {
production: false,
- mpsServer: 'http://localhost:3000',
- rpsServer: 'http://localhost:8081',
- vault: 'http://localhost/vault'
+ mpsServer: 'https://10.0.0.219/mps',
+ rpsServer: 'https://10.0.0.219/rps',
+ vault: 'https://10.0.0.219/vault'
}
/*
The tests will fail as they have 'localhost' hardcoded in some strings.
Expected behavior
Tests should succeed.
Additional context
This will fix the problem. Using 'URL' to extract the hostname should be different enough to component.formServerUrl() for the test to be worthwhile.
diff --git a/src/app/shared/deactivate-device/deactivate-device.component.spec.ts b/src/app/shared/deactivate-device/deactivate-device.component.spec.ts
index babe200..cbd8909 100644
--- a/src/app/shared/deactivate-device/deactivate-device.component.spec.ts
+++ b/src/app/shared/deactivate-device/deactivate-device.component.spec.ts
@@ -51,7 +51,7 @@ describe('DeactivateDeviceComponent', () => {
expect(component.rpcLinux).toBe('sudo ./rpc ')
expect(component.rpcDocker).toBe('sudo docker run --device=/dev/mei0 rpc:latest ')
expect(component.rpcWindows).toBe('rpc.exe ')
- expect(component.deactivationUrl).toBe('sudo ./rpc -u wss://localhost/activate ')
+ expect(component.deactivationUrl).toBe('sudo ./rpc -u wss://' + new URL(environment.rpsServer).hostname + '/activate ')
expect(component.serverUrl).toBe(`-u wss://${component.formServerUrl()}/activate `)
expect(component.deactivationCommand).toBe('')
expect(component.isCopied).toBe(false)
@@ -75,17 +75,17 @@ describe('DeactivateDeviceComponent', () => {
it('should set linux deactivation url', () => {
component.selectedPlatform = 'Linux'
component.formDeactivationUrl()
- expect(component.deactivationUrl).toBe('sudo ./rpc -u wss://localhost/activate ')
+ expect(component.deactivationUrl).toBe('sudo ./rpc -u wss://' + new URL(environment.rpsServer).hostname + '/activate ')
})
it('should set windows deactivation url', () => {
component.selectedPlatform = 'wiNDows'
component.formDeactivationUrl()
- expect(component.deactivationUrl).toBe('rpc.exe -u wss://localhost/activate ')
+ expect(component.deactivationUrl).toBe('rpc.exe -u wss://' + new URL(environment.rpsServer).hostname + '/activate ')
})
it('should set docker deactivation url', () => {
component.selectedPlatform = 'docker'
component.formDeactivationUrl()
- expect(component.deactivationUrl).toBe('sudo docker run --device=/dev/mei0 rpc:latest -u wss://localhost/activate ')
+ expect(component.deactivationUrl).toBe('sudo docker run --device=/dev/mei0 rpc:latest -u wss://' + new URL(environment.rpsServer).hostname + '/activate ')
})
it('should set the isCopied flag to true on click of copy icon ', fakeAsync(() => {
- 主要言語
- TypeScript
- スター
- 13
- フォーク
- 19
- 平均マージ
- 1日 13分
- マージ済み PR(30日)
- 42
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
device-management-toolkit/sample-web-ui のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
device-management-toolkit/sample-web-ui#3711 ·
メンテナーはふだん 1 日以内に返信
-
Persist provisioning progress so UI can show activation stage during in-flight provisioning再び着手できるかも @nbmaiti が 115 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンuser-experience
device-management-toolkit/sample-web-ui#3472 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
device-management-toolkit/sample-web-ui#3429 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add handler for the max wifi profile limit reached error and surface up the error to user再び着手できるかも @shaoboon が 146 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
device-management-toolkit/sample-web-ui#3388 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Enhancement: Implement Automatic Device Status Synchronization対応中かも @punam20 が 15 日前に担当しました。 オープンbug stability-tests
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
device-management-toolkit/sample-web-ui#3333 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
device-management-toolkit/sample-web-ui の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
solidjs/solid-docs#1716 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Progress indicated by console logs is off by one対応中かも @marceliwac が今日担当しました。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aws-samples/aws-cdk-examples#1336 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
melgarafael/DeskcommCRM#4999 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信