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

[Test] Enable unit test suite: telemetry_sender.test.ts #500

Merged
merged 2 commits into from
Jun 26, 2021

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented Jun 18, 2021

Description

All the unit tests related to unused telemetry are temporarily
skipped at forking. Unit tests of the disabled telemetry
functions should also be modified correspondingly. To build
a clean unit test, we decide to modify and enable all the
working unit tests. This PR modifies and enables
telemetry_sender.test.ts.

Signed-off-by: Anan Zhuang [email protected]

Issues Resolved

#498

Test results

unit test for telemetry_sender.test.ts

yarn test:jest /home/anan/work/OpenSearch-Dashboards/src/plugins/telemetry/public/services/telemetry_sender.test.ts
yarn run v1.22.10
$ node scripts/jest /home/anan/work/OpenSearch-Dashboards/src/plugins/telemetry/public/services/telemetry_sender.test.ts
 PASS  src/plugins/telemetry/public/services/telemetry_sender.test.ts
  TelemetrySender
    constructor
      ✓ defaults lastReport if unset (5 ms)
      ✓ uses lastReport if set (1 ms)
    saveToBrowser
      ✓ uses lastReport
    shouldSendReport
      ✓ returns false whenever optIn is false
      ✓ returns true if lastReported is undefined (1 ms)
      ✓ returns true if lastReported passed REPORT_INTERVAL_MS (1 ms)
      ✓ returns false if lastReported is within REPORT_INTERVAL_MS
      ✓ returns true if lastReported is malformed (1 ms)
      sendIfDue
        ✓ does not send if already sending (1 ms)
        ✓ does not send if shouldSendReport returns false (1 ms)
        ✓ sends report if due (1 ms)
        ✓ sends report separately for every cluster
        ✓ updates last lastReported and calls saveToBrowser (1 ms)
        ✓ catches fetchTelemetry errors and sets isSending to false (1 ms)
        ✓ catches fetch errors and sets isSending to false (1 ms)
    startChecking
      ✓ calls sendIfDue every 60000 ms (1 ms)

Test Suites: 1 passed, 1 total
Tests:       16 passed, 16 total
Snapshots:   0 total
Time:        3.94 s, estimated 4 s

Overall test result:
Screen Shot 2021-06-18 at 12 40 31 PM

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

…roject#498)

All the unit tests related to unused telemetry are temporarily
skipped at forking. Unit tests of the disabled telemetry
functions should also be modified correspondingly. To build
a clean unit test, we decide to modify and enable all the
working unit tests. This PR modifies and enables
telemetry_sender.test.ts.

Signed-off-by: Anan Zhuang <[email protected]>
@opensearch-ci-bot
Copy link
Collaborator

❌   DCO Check Failed 7f2e731
Run ./dev-tools/signoff-check.sh remotes/origin/main 7f2e731ebc52ae3cb09b31d93e151eb6384a4ab8 to check locally
Use git commit with -s to add 'Signed-of-by: {EMAIL}' on impacted commits

@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 4a0ad4a

@ananzh ananzh mentioned this pull request Jun 18, 2021
26 tasks
@ananzh ananzh changed the title [Test] Enable unit test suite: telemetry_sender.test.ts (#498) [Test] Enable unit test suite: telemetry_sender.test.ts Jun 18, 2021
Remove all the original comment out lines. If needs
restore the unit test, can revert this commit.

Signed-off-by: Anan Zhuang <[email protected]>
@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 506ffb7

Copy link
Member Author

@ananzh ananzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have cleaned the commented lines. please take another look. thanks @tmarkley @kavilla

Copy link
Contributor

@tmarkley tmarkley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@ananzh ananzh merged commit 1e7b8f1 into opensearch-project:main Jun 26, 2021
kavilla pushed a commit that referenced this pull request Jun 26, 2021
* [Test] Enable unit test suite: telemetry_sender.test.ts (#498)

All the unit tests related to unused telemetry are temporarily
skipped at forking. Unit tests of the disabled telemetry
functions should also be modified correspondingly. To build
a clean unit test, we decide to modify and enable all the
working unit tests. This PR modifies and enables
telemetry_sender.test.ts.

Signed-off-by: Anan Zhuang <[email protected]>

* [Test] Enable unit test suite: telemetry_sender.test.ts

Remove all the original comment out lines. If needs
restore the unit test, can revert this commit.

Signed-off-by: Anan Zhuang <[email protected]>
kavilla pushed a commit that referenced this pull request Jun 26, 2021
* [Test] Enable unit test suite: telemetry_sender.test.ts (#498)

All the unit tests related to unused telemetry are temporarily
skipped at forking. Unit tests of the disabled telemetry
functions should also be modified correspondingly. To build
a clean unit test, we decide to modify and enable all the
working unit tests. This PR modifies and enables
telemetry_sender.test.ts.

Signed-off-by: Anan Zhuang <[email protected]>

* [Test] Enable unit test suite: telemetry_sender.test.ts

Remove all the original comment out lines. If needs
restore the unit test, can revert this commit.

Signed-off-by: Anan Zhuang <[email protected]>
@ananzh ananzh deleted the i-498 branch September 14, 2021 17:34
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
The commit adds a first alpha version of the SmallMultiple chart configuration as requested in opensearch-project#500
Two main components are used to describe the small multiples:
- `<GroupBy />` is a generic component that allows the specification of a group by operation and sorting order. The `by` prop request a function with two arguments, the spec and the datum. It's called for each spec and for each data point available in the data array of a spec. It should return a unique value used to group the data points into multiple series.
- `<SmallMultiples />` component with two main optional props: `splitVertically` or `splitHorizontally` where you can specify the `id` of a `GroupBy` operator to render vertically (one below the other) or horizontally (one aside the other) the series defined by that group operation. A preliminary style configuration can be used to configure inner and outer padding in percentage for the vertical or horizontal charts.

close opensearch-project#500 

Co-authored-by: Nick Partridge <[email protected]>
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [24.1.0](elastic/elastic-charts@v24.0.0...v24.1.0) (2020-11-24)

### Bug Fixes

* **area_charts:** correctly represent baseline with negative data points ([opensearch-project#896](elastic/elastic-charts#896)) ([b622fda](elastic/elastic-charts@b622fda))
* **legend:** legend sizes with ordinal data ([opensearch-project#867](elastic/elastic-charts#867)) ([74bcbad](elastic/elastic-charts@74bcbad)), closes [opensearch-project#811](elastic/elastic-charts#811)
* render orphan data points on lines and areas ([opensearch-project#900](elastic/elastic-charts#900)) ([3e2c739](elastic/elastic-charts@3e2c739)), closes [opensearch-project#783](elastic/elastic-charts#783)
* specs swaps correctly reflected in state ([opensearch-project#901](elastic/elastic-charts#901)) ([a94347f](elastic/elastic-charts@a94347f))

### Features

* **legend:** allow legend text to be copyable ([opensearch-project#877](elastic/elastic-charts#877)) ([21a96d3](elastic/elastic-charts@21a96d3)), closes [opensearch-project#710](elastic/elastic-charts#710)
* allow clearing series colors from memory ([opensearch-project#899](elastic/elastic-charts#899)) ([e97f4ab](elastic/elastic-charts@e97f4ab))
* merge series domain with the domain of another group ([opensearch-project#912](elastic/elastic-charts#912)) ([716ad5a](elastic/elastic-charts@716ad5a))
* small multiples for XY charts (alpha) ([opensearch-project#793](elastic/elastic-charts#793)) ([3b88e1c](elastic/elastic-charts@3b88e1c)), closes [opensearch-project#500](elastic/elastic-charts#500) [opensearch-project#500](elastic/elastic-charts#500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants