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

Update e2e instructions #7442

Open
wants to merge 9 commits into
base: v3.33
Choose a base branch
from
Open

Update e2e instructions #7442

wants to merge 9 commits into from

Conversation

ryaplots
Copy link
Contributor

Summary

References https://github.com/TheThingsIndustries/lorawan-stack/issues/4471
This PR updates the documentation regarding how to run the stack locally for frontend development and how to run the e2e tests locally.

Changes

  • Update serve-dev-webui.js tool to support cypress tests
  • Update docs

Testing

Steps
  1. Run e2e tests with laucher tool following development.md

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • Testing: The steps/process to test this feature are clearly explained including testing for regressions.
  • Infrastructure: If infrastructural changes (e.g., new RPC, configuration) are needed, a separate issue is created in the infrastructural repositories.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@ryaplots ryaplots added the tooling Development tooling label Dec 13, 2024
@ryaplots ryaplots added this to the v3.33.1 milestone Dec 13, 2024
@ryaplots ryaplots self-assigned this Dec 13, 2024
@ryaplots ryaplots requested review from a team as code owners December 13, 2024 10:57
DEVELOPMENT.md Outdated Show resolved Hide resolved
DEVELOPMENT.md Outdated Show resolved Hide resolved
DEVELOPMENT.md Outdated
#### Development Configuration

> To use a convenient interactive launcher for the development environments without any further setup required, please see the (interactive development stack launcher tool)[#interactive-development-stack-launcher-tool]
> The preffered way to set up the development environment is to use the [interactive development stack launcher tool](#interactive-development-stack-launcher-tool).

In order to set up The Things Stack to support running the frontend via `webpack-dev-server`, the following environment setup is needed:
Copy link
Member

Choose a reason for hiding this comment

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

So all these env blocks are only needed when not using dev:serveDevWebui, right?

If that is the case, can this be moved lower in the page for advanced use?

DEVELOPMENT.md Outdated Show resolved Hide resolved
@johanstokking
Copy link
Member

What I'm getting is tons of stack errors about Redis keys not existing:

[stack] WARN    Task failed     {"error": "error:pkg/redis:store (store error)", "error_cause": "NOGROUP No such key 'ttn:v3:is:tasks:telemetry:ready' or consumer group 'is' in XREADGROUP with GROUP option", "invocation": 13, "namespace": "identityserver", "task_id": "is_telemetry_consumer_0"}
[stack] ERROR   Failed to pop entry from downlink task queue    {"error": "error:pkg/redis:store (store error)", "error_cause": "NOGROUP No such key 'ttn:v3:ns:tasks:downlink:ready' or consumer group 'ns' in XREADGROUP with GROUP option", "namespace": "networkserver"}

This is probably because of dev:redisFlush. But shoudn't there be some sort of restore of the Redis database? Or am I doing something wrong still?

@ryaplots ryaplots requested a review from a team as a code owner December 17, 2024 12:36
@ryaplots ryaplots requested review from nicholaspcr and removed request for mjamescompton and a team December 17, 2024 13:24
@ryaplots
Copy link
Contributor Author

ryaplots commented Dec 17, 2024

This is probably because of dev:redisFlush. But shoudn't there be some sort of restore of the Redis database? Or am I doing something wrong still?

I am also seeing these warnings. It's weird because we before we also didn't restore the Redis db, but these warnings weren't there. Besides, dev:redisFlush only deletes the keys that were created during testing, it does not drop the db.

@johanstokking
Copy link
Member

I am also seeing these warnings. It's weird because we before we also didn't restore the Redis db, but these warnings weren't there. Besides, dev:redisFlush only deletes the keys that were created during testing, it does not drop the db.

I wonder how it worked before. This dev:redisFlush does actually flush the database, as in it looks like it deletes all keys. That's an issue because there are some "system" keys that are not tested-related that should not be deleted.

@ryaplots
Copy link
Contributor Author

I am also seeing these warnings. It's weird because we before we also didn't restore the Redis db, but these warnings weren't there. Besides, dev:redisFlush only deletes the keys that were created during testing, it does not drop the db.

I wonder how it worked before. This dev:redisFlush does actually flush the database, as in it looks like it deletes all keys. That's an issue because there are some "system" keys that are not tested-related that should not be deleted.

I see. How do I know which keys are test-related and delete only those?

@johanstokking
Copy link
Member

I am also seeing these warnings. It's weird because we before we also didn't restore the Redis db, but these warnings weren't there. Besides, dev:redisFlush only deletes the keys that were created during testing, it does not drop the db.

I wonder how it worked before. This dev:redisFlush does actually flush the database, as in it looks like it deletes all keys. That's an issue because there are some "system" keys that are not tested-related that should not be deleted.

I see. How do I know which keys are test-related and delete only those?

I think that everything can be deleted except:

2) "ttn:v3:ns:tasks:downlink:ready"
3) "ttn:v3:ns:tasks:downlink:input"
8) "ttn:v3:ns:application-uplinks:uplinks"

Also make sure that telemetry is disabled in the config (if that is not already the case).

Alternatively, as part of flushing the Redis database, the stack may also be restarted. Then it recreates these Redis keys automatically. Not sure if it is possible/desired to restart the stack between tests though?

Copy link
Contributor

@nicholaspcr nicholaspcr left a comment

Choose a reason for hiding this comment

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

Tried to run the E2E locally it was really easy to setup, very helpful.

I left some comments regarding the readability of the development.md.

DEVELOPMENT.md Outdated Show resolved Hide resolved
DEVELOPMENT.md Outdated Show resolved Hide resolved
DEVELOPMENT.md Outdated Show resolved Hide resolved
@ryaplots ryaplots requested a review from nicholaspcr December 20, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Development tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants