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

chore: add test utils string generators #879

Merged
merged 12 commits into from
Nov 10, 2023
Merged

Conversation

romanzac
Copy link
Collaborator

@romanzac romanzac commented Nov 8, 2023

Description
Utility functions to generate strings of various nature for advanced testing

Tests available to run:
cd go-waku/tests
go test -run TestStringGenerators

romanzac and others added 6 commits October 28, 2023 11:40
* test: Test incorrect protocol identifiers

* fix: return errors in FilterSubscribeOption

* test: Test incorrect push identifier added
- test incorrect subscribe identifier separated

* test: Test Ping failure after unsubscription

* test: Test PubSub with single content topic

* test: Simplify test PubSub with single content topic

* test: Test with single pubsub and multiple content topics

* test: Test with multiple PubSub and multiple contentTopic

* test: Test with multiple overlaping contentTopics
- test contentTopics limit

* test: refactor tests to fix concurrent run errors

* test: Test subscription refresh

* test: Test error handling for subscribe

* test: Test subscription to multiple full nodes

* update test to fix #804

* Update waku/v2/protocol/filter/filter_test.go

Combine log messages

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Delete commented - temporary code

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

fmt.Sprintf instead of "+" suffix => more performance and beauty

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Adjust comment with code

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Combine multiple related log entries into one.

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Align comment with the code

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Use fmt.Sprintf() instead of "+" for more beauty and speed

Co-authored-by: richΛrd <info@richardramos.me>

* test: refactor tests with prepareData()

* test: Test incorrect protocol identifiers

* chore: rebase onto latest master

* test: Test incorrect push identifier added
- test incorrect subscribe identifier separated

* test: Test Ping failure after unsubscription

* test: Test PubSub with single content topic

* test: Simplify test PubSub with single content topic

* test: Test with single pubsub and multiple content topics

* test: Test with multiple PubSub and multiple contentTopic

* test: Test with multiple overlaping contentTopics
- test contentTopics limit

* test: refactor tests to fix concurrent run errors

* test: Test subscription refresh

* test: Test error handling for subscribe

* test: Test subscription to multiple full nodes

* update test to fix #804

* Update waku/v2/protocol/filter/filter_test.go

Combine log messages

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Delete commented - temporary code

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

fmt.Sprintf instead of "+" suffix => more performance and beauty

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Adjust comment with code

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Combine multiple related log entries into one.

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Align comment with the code

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Use fmt.Sprintf() instead of "+" for more beauty and speed

Co-authored-by: richΛrd <info@richardramos.me>

* test: refactor tests with prepareData()

* test: Test incorrect protocol identifiers

* fix: return errors in FilterSubscribeOption

* test: Test incorrect push identifier added
- test incorrect subscribe identifier separated

* test: Test Ping failure after unsubscription

* test: Test PubSub with single content topic

* test: Simplify test PubSub with single content topic

* test: Test with single pubsub and multiple content topics

* test: Test with multiple PubSub and multiple contentTopic

* test: Test with multiple overlaping contentTopics
- test contentTopics limit

* test: refactor tests to fix concurrent run errors

* test: Test subscription refresh

* test: Test error handling for subscribe

* test: Test subscription to multiple full nodes

* update test to fix #804

* Update waku/v2/protocol/filter/filter_test.go

Combine log messages

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Delete commented - temporary code

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

fmt.Sprintf instead of "+" suffix => more performance and beauty

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Adjust comment with code

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Combine multiple related log entries into one.

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Align comment with the code

Co-authored-by: richΛrd <info@richardramos.me>

* Update waku/v2/protocol/filter/filter_test.go

Use fmt.Sprintf() instead of "+" for more beauty and speed

Co-authored-by: richΛrd <info@richardramos.me>

* test: refactor tests with prepareData()

* Fix error during rebase

* Sync filter tests with latest master

* Refactor context initialization for test

* test: Incorrect Subscribe Identifier refactored with custom subscribe

* test: refactor into multiple files

* test: Subscribe with multiple light nodes to one full node

* test: shared mode for full node creation
- test preview Subscribe fullNode to fullNode

* test: test Subscribe fullNode to fullNode

---------

Co-authored-by: Richard Ramos <info@richardramos.me>
Co-authored-by: Prem Chaitanya Prathi <chaitanyaprem@gmail.com>
@status-im-auto
Copy link

status-im-auto commented Nov 8, 2023

Jenkins Builds

Click to see older builds (30)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f2bdd69 #1 2023-11-08 11:58:56 ~2 min linux 📦deb
✔️ f2bdd69 #1 2023-11-08 12:00:10 ~4 min android 📦tgz
✔️ f2bdd69 #1 2023-11-08 12:00:43 ~4 min ios 📦tgz
✔️ f2bdd69 #1 2023-11-08 12:00:49 ~4 min nix-flake 📄log
✖️ f2bdd69 #1 2023-11-08 12:01:46 ~5 min tests 📄log
✖️ f2bdd69 #1 2023-11-08 12:02:23 ~6 min tests 📄log
✔️ 905e62d #2 2023-11-08 12:37:34 ~3 min ios 📦tgz
✔️ 905e62d #2 2023-11-08 12:40:57 ~6 min linux 📦deb
✔️ 905e62d #2 2023-11-08 12:41:07 ~6 min nix-flake 📄log
✔️ 905e62d #2 2023-11-08 12:41:34 ~7 min android 📦tgz
✔️ 905e62d #2 2023-11-08 12:43:45 ~9 min tests 📄log
✔️ 905e62d #2 2023-11-08 12:44:34 ~10 min tests 📄log
✔️ 4a3e49e #3 2023-11-08 12:40:22 ~4 min ios 📦tgz
✔️ 4a3e49e #3 2023-11-08 12:46:13 ~5 min linux 📦deb
✔️ 4a3e49e #3 2023-11-08 12:46:46 ~5 min nix-flake 📄log
✔️ 4a3e49e #3 2023-11-08 12:49:23 ~4 min tests 📄log
✔️ 4a3e49e #3 2023-11-08 12:49:55 ~8 min android 📦tgz
✔️ 4a3e49e #3 2023-11-08 12:50:03 ~6 min tests 📄log
✔️ 22d7352 #4 2023-11-08 14:52:43 ~2 min nix-flake 📄log
✔️ 22d7352 #4 2023-11-08 14:53:05 ~2 min linux 📦deb
✔️ 22d7352 #4 2023-11-08 14:53:09 ~2 min tests 📄log
✔️ 22d7352 #4 2023-11-08 14:53:35 ~3 min tests 📄log
✔️ 22d7352 #4 2023-11-08 14:54:12 ~3 min ios 📦tgz
✔️ 22d7352 #4 2023-11-08 14:54:19 ~3 min android 📦tgz
✔️ c816067 #5 2023-11-09 00:48:54 ~1 min linux 📦deb
✔️ c816067 #5 2023-11-09 00:49:47 ~2 min nix-flake 📄log
✔️ c816067 #5 2023-11-09 00:50:07 ~2 min tests 📄log
✔️ c816067 #5 2023-11-09 00:50:23 ~2 min tests 📄log
✔️ c816067 #5 2023-11-09 00:51:29 ~3 min android 📦tgz
✔️ c816067 #5 2023-11-09 00:52:03 ~4 min ios 📦tgz
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 665f92a #6 2023-11-09 02:20:32 ~1 min linux 📦deb
✔️ 665f92a #6 2023-11-09 02:20:47 ~1 min tests 📄log
✔️ 665f92a #6 2023-11-09 02:21:18 ~1 min nix-flake 📄log
✔️ 665f92a #6 2023-11-09 02:21:55 ~2 min tests 📄log
✔️ 665f92a #6 2023-11-09 02:22:48 ~3 min ios 📦tgz
✔️ 665f92a #6 2023-11-09 02:22:59 ~3 min android 📦tgz
✔️ cc270a4 #7 2023-11-10 02:13:33 ~1 min linux 📦deb
✔️ cc270a4 #7 2023-11-10 02:14:09 ~1 min tests 📄log
✔️ cc270a4 #7 2023-11-10 02:14:16 ~1 min nix-flake 📄log
✔️ cc270a4 #7 2023-11-10 02:14:56 ~2 min tests 📄log
✔️ cc270a4 #7 2023-11-10 02:16:23 ~4 min ios 📦tgz
✔️ cc270a4 #7 2023-11-10 02:16:24 ~4 min android 📦tgz

tests/utils.go Fixed Show fixed Hide fixed
tests/utils.go Fixed Show fixed Hide fixed
@richard-ramos richard-ramos changed the title Test utils string generators chore: test utils string generators Nov 8, 2023
@richard-ramos richard-ramos changed the title chore: test utils string generators chore: add test utils string generators Nov 8, 2023
Copy link
Member

@richard-ramos richard-ramos left a comment

Choose a reason for hiding this comment

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

Seems okay to me.
I do wonder if there is value in having tests for test utils.

@romanzac
Copy link
Collaborator Author

Seems okay to me. I do wonder if there is value in having tests for test utils.

Testing string generators to minimize potential doubt; the tests I am about to write will run with different data for each iteration.

@romanzac romanzac merged commit 24879b2 into master Nov 10, 2023
10 of 12 checks passed
@romanzac romanzac deleted the test-utils-string-generators branch November 10, 2023 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants