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(e2e): settings tests #167

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

test(e2e): settings tests #167

wants to merge 7 commits into from

Conversation

QZera
Copy link
Collaborator

@QZera QZera commented Dec 1, 2024

Prerequisite #162

  • Tests the "Path to Rad Binary" and "Path to Node Home" extension settings

Notes:

  • The tests that verify that the extension recognizes paths that are created after the setting is updated are implemented but marked to be skipped by the runner. As discussed, this functionality should work but doesn't at the moment
  • The "Path to Node Home" tests are skipped on the Linux CI, as there seems to be an issue where the extension does not correctly pick up the initial node home path (from the RAD_HOME env var)

@QZera QZera force-pushed the feat/settings-e2e-tests branch 11 times, most recently from 65d319d to 1046eb8 Compare December 1, 2024 19:08
@QZera QZera changed the title Feat/settings e2e tests test(e2e): setting tests Dec 1, 2024
@QZera QZera force-pushed the feat/settings-e2e-tests branch from 1046eb8 to 800e371 Compare December 2, 2024 07:07
@QZera QZera force-pushed the feat/settings-e2e-tests branch 17 times, most recently from 46b1f43 to 5a28f5e Compare December 27, 2024 10:43
@QZera QZera force-pushed the feat/settings-e2e-tests branch 10 times, most recently from fb82cd9 to a62b0b6 Compare January 4, 2025 10:23
@QZera QZera changed the title test(e2e): setting tests test(e2e): settings tests Jan 6, 2025
@QZera QZera force-pushed the feat/settings-e2e-tests branch from c29da1e to c1b8f16 Compare January 6, 2025 10:08
QZera added 3 commits January 6, 2025 12:35
- adds tests for the "path to rad binary" setting
- adds cleanup logic to the onboarding suite
- updates config to run onboarding and settings suites sequentially
- updates e2e ci workflow to ensure both platforms run regardless of each other's outcome

Signed-off-by: Zacharias Fragkiadakis <[email protected]>
- Adds test for the "path to node home" setting
- Allows skipping tests based on platform by including `@skip{platform}CI` in the test name

Signed-off-by: Zacharias Fragkiadakis <[email protected]>
- Sets "waitFor" timeout globally
- Extracts some functions to helper files
- Generally cleans up the test suite

Signed-off-by: Zacharias Fragkiadakis <[email protected]>
@QZera QZera force-pushed the feat/settings-e2e-tests branch from 747f07b to b79dae5 Compare January 6, 2025 10:35
@QZera QZera marked this pull request as ready for review January 6, 2025 10:39
@QZera QZera requested a review from maninak January 6, 2025 10:39
@QZera QZera self-assigned this Jan 6, 2025
Copy link
Collaborator

@maninak maninak left a comment

Choose a reason for hiding this comment

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

EDIT: Oh w8, reviewed wrong PR. I'll get to this one next, soz!

Copy link
Collaborator

@maninak maninak left a comment

Choose a reason for hiding this comment

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

see above

Copy link
Collaborator

@maninak maninak left a comment

Choose a reason for hiding this comment

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

I still need to have a second look, particularly for the details of the logic in settings.spec.ts, but for now some early comments.

In addition to the inline ones, I want to address a couple more general ones:

  1. regarding changing setting values, I wonder if we take into account (and if we should, if not) the debounce that seems to be between setting changing the input field's value and it "registering". Perhaps we could "blur" the focus instead of waiting which seems to trigger registering of the new value instantly.
  2. if running (a subset, as previously discussed) of the e2e tests locally is now safe, i.e. won't impact local setup, we should revisit restoring the npm script test:e2e inside the top-level script "test".

test/e2e/wdio.conf.ts Show resolved Hide resolved
test/e2e/wdio.conf.ts Outdated Show resolved Hide resolved
test/e2e/specs/settings.spec.ts Outdated Show resolved Hide resolved
test/e2e/specs/settings.spec.ts Outdated Show resolved Hide resolved
test/e2e/helpers/assertions.ts Outdated Show resolved Hide resolved
test/e2e/helpers/assertions.ts Outdated Show resolved Hide resolved
test/e2e/specs/settings.spec.ts Show resolved Hide resolved
test/e2e/specs/settings.spec.ts Outdated Show resolved Hide resolved
Comment on lines +91 to +98
/**
* In Linux CI:
* - The extension is having issues resolving the correct node home directory (RAD_HOME).
* - Even when node home is set explicitly in the settings, the extension incorrectly reports it
* as non-authenticated.
*/
// eslint-disable-next-line max-len
describe('VS Code, when updating the "Path to Radicle to Node Home" setting, @skipLinuxCI', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Skipping tests, especially on Linux CI, along with the whole setup that comes to support this on the runner level is both hacky and and risky.

These various odd issues we've been having on the environment level smell to me that we need to look upwards to sniff out the root cause (e.g. in e2e-testing.yaml, or wdio config, or investigate CLI bug with the maintainers, ...?) or it will keep forcing more hacks down our throats.

At the very least, here could we at least source the value of RAD_HOME alternatively e.g. with rad self --home and remove all those @skipLinuxCI markers and related supporting logic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe this might actually be a bug in the extension on Linux specifically.

I've created a branch and a draft PR with a minimal test to illustrate this. (Check the result of the ubuntu job)

However since I'm not on Linux, I can't reproduce it locally, and I'd like to confirm with you before creating a bug. Could you help reproduce this?

As far a I can tell, based on e2e-testing.yaml, the steps to reproduce this are:

  1. before installing Radicle, set RAD_HOME to non-default path
  2. install radicle
  3. create a new radicle identity (rad auth)
  4. start VSCode
  5. open the Radicle channel in the Output Panel

The radicle identity should be picked up correctly, but according to my testing it is not.

Copy link
Collaborator

@maninak maninak Jan 29, 2025

Choose a reason for hiding this comment

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

It looks like for the tests we're creating a non-password protected Radicle identity.

Yet in the test you shared we're (falsely!) expecting to read "Using already unsealed Radicle identity" in the Radicle Output channel. In this case the expected output is "Using non-password-protected Radicle identity".

In fact it would be better that all our tests use a password-protected identity by default to better simulate real-world scenarios. There's also good argument to cover with tests some basic functionality (similar to what you've done in your testing PR above, actually) to ensure we haven't broken support for non-password-protected identities (has happened to me in the past..).

@QZera QZera force-pushed the feat/settings-e2e-tests branch 2 times, most recently from a2e4e4f to 1e20b85 Compare January 22, 2025 09:33
QZera added 3 commits January 22, 2025 11:50
Signed-off-by: Zacharias Fragkiadakis <[email protected]>
Signed-off-by: Zacharias Fragkiadakis <[email protected]>
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.

2 participants