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

886 Print network profiles #906

Merged
merged 9 commits into from
Jul 21, 2020
Merged

886 Print network profiles #906

merged 9 commits into from
Jul 21, 2020

Conversation

adamfilipow92
Copy link
Contributor

@adamfilipow92 adamfilipow92 commented Jul 21, 2020

Fixes #886

Test Plan

How do we know the code works?

Command


flank firebase test network-profiles list

and


flank network-profiles list

Should print table


┌────────────┬──────┬────────┬────────────┬───────────────────┬───────────┬───────┐
│ PROFILE_ID │ RULE │ DELAY  │ LOSS_RATIO │ DUPLICATION_RATIO │ BANDWIDTH │ BURST │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.040s │   0.001    │                   │  16000.0  │       │
│    LTE     │ down │ 0.040s │   0.001    │                   │  16000.0  │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.060s │   0.0015   │                   │  4000.0   │       │
│  LTE-poor  │ down │ 0.060s │   0.0015   │                   │  4000.0   │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.060s │   0.001    │                   │  2000.0   │       │
│    HSPA    │ down │ 0.060s │   0.001    │                   │  4000.0   │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.100s │   0.0015   │                   │   500.0   │       │
│ HSPA-poor  │ down │ 0.100s │   0.0015   │                   │  1000.0   │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.060s │    0.02    │                   │  2000.0   │       │
│    UMTS    │ down │ 0.060s │    0.02    │                   │  2000.0   │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.090s │    0.04    │                   │   384.0   │       │
│ UMTS-poor  │ down │ 0.090s │    0.04    │                   │   384.0   │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.150s │    0.04    │                   │   384.0   │       │
│    EDGE    │ down │ 0.150s │    0.04    │                   │   384.0   │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.200s │    0.08    │                   │   96.0    │       │
│ EDGE-poor  │ down │ 0.200s │    0.08    │                   │   96.0    │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.300s │    0.08    │                   │   172.0   │       │
│    GPRS    │ down │ 0.300s │    0.08    │                   │   172.0   │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.500s │    0.1     │                   │   48.0    │       │
│ GPRS-poor  │ down │ 0.500s │    0.1     │                   │   48.0    │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.500s │    0.08    │                   │    9.6    │       │
│    GSM     │ down │ 0.500s │    0.08    │                   │    9.6    │       │
├────────────┼──────┼────────┼────────────┼───────────────────┼───────────┼───────┤
│            │  up  │ 0.600s │    0.1     │                   │    2.4    │       │
│  GSM-poor  │ down │ 0.600s │    0.1     │                   │    2.4    │       │
└────────────┴──────┴────────┴────────────┴───────────────────┴───────────┴───────┘

also


flank firebase test android|ios test-environment 

should print this table at the end of the output.

WDYT

I added row separator to all tables to keep one style. In my opinion, it looks fine but on the other hand, the table with row separator takes more space. Tell me please what you think. Maybe we shouldn't add row separators to all tables.

Checklist

  • Unit tested
  • release_notes.md updated
  • Printing network profiles on flank firebase test network-profiles list
  • Printing network profiles on flank firebase test android|ios test-environment

@adamfilipow92 adamfilipow92 marked this pull request as ready for review July 21, 2020 13:10
@adamfilipow92 adamfilipow92 self-assigned this Jul 21, 2020
@adamfilipow92 adamfilipow92 requested review from piotradamczyk5, jan-goral and bootstraponline and removed request for piotradamczyk5 July 21, 2020 13:10
} returns configurationsMock
every { configurationsMock.asPrintableTable() } returns ""
CommandLine(NetworkProfilesListCommand()).execute()
verify { configurationsMock.asPrintableTable() }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we have response for this call-in mocked server. Could we use it somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% sure but probably I need to mock it to check printing is executed on command run.

@piotradamczyk5
Copy link
Contributor

Could you add also the possibility to run table using a command
flank network-profiles list
?

@adamfilipow92 adamfilipow92 marked this pull request as draft July 21, 2020 14:25
@@ -24,6 +26,7 @@ class AndroidTestEnvironmentCommand : Runnable {
println(devicesCatalogAsTable(AndroidArgs.load(Paths.get(configPath)).project))
println(supportedVersionsAsTable(AndroidArgs.load(Paths.get(configPath)).project))
println(providedSoftwareAsTable())
println(GcTesting.networkConfiguration().asPrintableTable())
Copy link
Contributor

@piotradamczyk5 piotradamczyk5 Jul 21, 2020

Choose a reason for hiding this comment

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

Could you update description to :

    header = ["Print available devices, OS versions, provided software list and network configuration to test against"],
    description = ["Print available Android devices, Android OS versions list, provided software and network configuration to test against"],

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

@@ -24,6 +26,7 @@ class IosTestEnvironmentCommand : Runnable {
println(devicesCatalogAsTable(IosArgs.load(Paths.get(configPath)).project))
println(softwareVersionsAsTable(IosArgs.load(Paths.get(configPath)).project))
println(providedSoftwareAsTable())
println(GcTesting.networkConfiguration().asPrintableTable())
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you update description to :

    header = ["Print available devices, OS versions, provided software list and network configuration to test against"],
    description = ["Print available iOS devices, iOS OS versions list, provided software and network configuration to test against"],

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

@piotradamczyk5
Copy link
Contributor

WDYT
I added row separator to all tables to keep one style. In my opinion, it looks fine but on the other hand, the table with row separator takes more space. Tell me please what you think. Maybe we shouldn't add row separators to all tables.

For me defaults separator should not be printed cause tables become larger (readability is a plus, but the size is a minus :( )

@adamfilipow92
Copy link
Contributor Author

WDYT
I added row separator to all tables to keep one style. In my opinion, it looks fine but on the other hand, the table with row separator takes more space. Tell me please what you think. Maybe we shouldn't add row separators to all tables.

For me defaults separator should not be printed cause tables become larger (readability is a plus, but the size is a minus :( )

So we thinking the same. I added a table style option and set default style without rows separation. Thanks for your feedback!

@adamfilipow92 adamfilipow92 marked this pull request as ready for review July 21, 2020 15:08
@piotradamczyk5
Copy link
Contributor

Great work 👍

@piotradamczyk5 piotradamczyk5 self-requested a review July 21, 2020 15:14
@adamfilipow92 adamfilipow92 merged commit bc7097d into master Jul 21, 2020
@adamfilipow92 adamfilipow92 deleted the 886-all-network branch July 21, 2020 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make printing available network configuration as a table to use during testing
2 participants