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

potential bug: RAD_HOME in linux #173

Draft
wants to merge 58 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
ada05f0
test(temp): delete non e2e workflows
QZera Dec 1, 2024
9f6cee9
test(temp): remove macos from e2e workflow
QZera Dec 1, 2024
5a16bbd
test(e2e): add initial test for path to rad binary setting
QZera Dec 1, 2024
8b8269e
test(e2e): test recognition when directory is created after the setti…
QZera Dec 26, 2024
958a36b
test(debug): simplify settings.spec.ts
QZera Dec 27, 2024
2eb8249
test(debug): increase pause before updating setting to 5s
QZera Dec 27, 2024
7683552
revert: "test(debug): increase pause before updating setting to 5s"
QZera Dec 27, 2024
af7d49c
test(debug): open radicle view container before initial assertion
QZera Dec 27, 2024
97ab6d6
test: open radicle view container *after* changing input value (works…
QZera Dec 27, 2024
1e17797
test: hoist variables outside of test case, in describe
QZera Dec 27, 2024
cf97cd7
revert: "test: hoist variables outside of test case, in describe"
QZera Dec 27, 2024
f786db6
test: update not found assertion interval to .5s and timeout to 20s
QZera Dec 27, 2024
37fcc82
test: add todo to fine-tune timeouts and intervals
QZera Dec 27, 2024
f712dc3
revert: ""revert: hoist variables outside of test case, in describe""
QZera Dec 27, 2024
5ea225b
test: add case for entering a valid path
QZera Dec 27, 2024
cc67ac5
test: increase timeout and decrease interval on cli and patches asser…
QZera Dec 27, 2024
8e02f89
test: clear setting input before updating it
QZera Dec 27, 2024
c9a6a0d
test: remove pauses before updating input value
QZera Dec 28, 2024
5838d68
test: log input value before clearing it
QZera Dec 28, 2024
54613c3
test(e2e): imrpove helper functions for manipulating settings
QZera Dec 28, 2024
8fc5080
test(e2e): remove TextSetting import in favor of Setting
QZera Dec 28, 2024
da2b6d9
test(e2e): add test for recognizing directory after updating setting
QZera Dec 28, 2024
214f57a
test(e2e): skip directory creation recognition case
QZera Dec 28, 2024
189c95d
test(e2e): close radicle view container after onboarding suite
QZera Dec 28, 2024
7b62e7b
test(e2e): move worbench and settings init to a before statement
QZera Dec 28, 2024
da9564b
test(e2e): open radicle view container before running settings suite
QZera Dec 28, 2024
ff85bd7
test(e2e): add describe statement for path to rad binary setting
QZera Dec 28, 2024
640aecf
test(e2e): add after each statement
QZera Dec 28, 2024
5136bf6
test(e2e): move initial state assertion to top level before statement
QZera Dec 28, 2024
0f19c41
test(e2e): move initial assertion after opening settings
QZera Dec 28, 2024
bf92a8e
test(e2e): do not open radicle sidebar view before assertion
QZera Dec 28, 2024
d458f4e
test(e2e): do not open radicle sidebar view before any assertions
QZera Dec 28, 2024
02d18a9
test(e2e): use chainable promises in settings.spec.ts
QZera Dec 28, 2024
f774ec3
chore(e2e): fix rebase ts errors
QZera Dec 30, 2024
a7272e9
test(e2e): remove pause before updating input
QZera Dec 30, 2024
dafb965
revert: "test(e2e): remove pause before updating input"
QZera Dec 30, 2024
ca3a0e2
test(e2e): write draft for initial path to node home test
QZera Dec 31, 2024
81971e0
test(e2e): clear output and join text before asserting error
QZera Dec 31, 2024
127f195
refactor(e2e): fix rebase error
QZera Dec 31, 2024
82c966b
test(e2e): do not re-select outputview
QZera Dec 31, 2024
98b135e
test(e2e): do not select radicle channel on output view
QZera Dec 31, 2024
b9fcf69
test(e2e): clear settings searchbox after first describe
QZera Dec 31, 2024
5ab76f2
test(e2e): remove empty input assertion
QZera Dec 31, 2024
76abf32
test(e2e): copy after statement to path to node home setting
QZera Dec 31, 2024
975ff4a
test(e2e): move findSetting to before statement
QZera Dec 31, 2024
1f10c51
test(e2e): remove browser pause before setting input value
QZera Dec 31, 2024
c325d82
test(e2e): refactor waitUntil statement
QZera Dec 31, 2024
0d99066
test(e2e): clear setting input and wait for output update
QZera Dec 31, 2024
a1690c8
test(e2e): log joined text
QZera Dec 31, 2024
bb63f2b
test(e2e): skip first settings suite
QZera Jan 4, 2025
c66b63f
test(e2e): skip all settings suite
QZera Jan 4, 2025
317fff0
test(debug): verify httpd is recognized in ubuntu
QZera Jan 4, 2025
127bad1
test(debug): don't clear output
QZera Jan 4, 2025
b89175c
test(debug): write new suite to verify httpd
QZera Jan 4, 2025
816b4b8
test(debug): manually set node home path to RAD_HOMe
QZera Jan 4, 2025
f229415
test(debug): log rad self
QZera Jan 4, 2025
e5f133d
test(e2e): delete settings.spec.ts
QZera Jan 26, 2025
57bf3f0
test(debug): cleanup
QZera Jan 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .github/workflows/code-linting.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/commit-linting.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/e2e-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ on:
jobs:
test-e2e:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
# os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:

Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/pr-linting.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions test/e2e/helpers/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ export async function openRadicleViewContainer(workbench: Workbench) {

await radicleViewControl?.openView()
}

export async function closeRadicleViewContainer(workbench: Workbench) {
const activityBar = workbench.getActivityBar()
await activityBar.wait()

const radicleViewControl = await activityBar.getViewControl('Radicle')
await radicleViewControl?.wait()

await radicleViewControl?.closeView()
}
7 changes: 6 additions & 1 deletion test/e2e/helpers/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export async function expectStandardSidebarViewsToBeVisible(workbench: Workbench
return false
}
},
{ timeoutMsg: 'expected the standard sidebar views to be visible' },
{
timeoutMsg: 'expected the standard sidebar views to be visible',
// TODO: zac fine tune these (globally?)
timeout: 20000,
interval: 500,
},
)
}
79 changes: 79 additions & 0 deletions test/e2e/specs/httpd.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { browser } from '@wdio/globals'
import type { OutputView, Setting } from 'wdio-vscode-service'
import { Key } from 'webdriverio'
import { $ } from 'zx'
import { nodeHomePath } from '../constants/config'

describe('Httpd', () => {
it('finds and uses radicle identity', async () => {
const workbench = await browser.getWorkbench()
await workbench.executeCommand('Show Everything Logged in the Output Panel')
const outputView = await workbench.getBottomBar().openOutputView()

const settings = await workbench.openSettings()
const pathToNodeHomeSetting = await settings.findSetting(
'Path To Node Home',
'Radicle',
'Advanced',
)

await browser.waitUntil(async () => {
await setTextSettingValue(pathToNodeHomeSetting, nodeHomePath ?? '')

return (await getTextSettingValue(pathToNodeHomeSetting)) === nodeHomePath
})

const radSelf = await $`rad self`
console.log({ radSelf })

await expectOutputToContain(outputView, 'Using already unsealed Radicle identity')
})
})

async function expectOutputToContain(outputView: OutputView, expected: string) {
await browser.waitUntil(
async () => {
/**
* The text in the output console is split by newlines, which can be affected by the size
* of the window. To avoid this, we join the text into a single string.
*/
const joinedText = (await outputView.getText()).join('')
console.log({ joinedText })

return joinedText.includes(expected)
},
{
timeoutMsg: `expected the output text to contain "${expected}"`,
},
)
}

/**
* Workaround to get the value of a `TextSetting`.
* The `getValue` method of a `TextSetting` seems to be wrongly implemented and returns null.
*/
async function getTextSettingValue(setting: Setting) {
return await setting.textSetting$.getValue()
}

async function setTextSettingValue(setting: Setting, value: string) {
await clearTextSetting(setting)
await setting.setValue(value)
}

async function clearTextSetting(setting: Setting) {
/**
* `.setValue('')` updates the value of the input but does not trigger an
* update in the extension. Not sure if this is a bug in the extension, vscode, or
* webdriverio.
*
* The following is a workaround that does trigger an update in the extension.
*/
if ((await getTextSettingValue(setting)) === '') {
return
}

await setting.textSetting$.click()
await browser.keys([Key.Ctrl, 'a'])
await browser.keys(Key.Backspace)
}
158 changes: 0 additions & 158 deletions test/e2e/specs/onboarding.spec.ts

This file was deleted.

2 changes: 1 addition & 1 deletion test/e2e/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const config: Options.Testrunner = {
transpileOnly: true,
},
},
specs: ['./specs/**/*.ts'],
specs: ['./specs/httpd.spec.ts'],
maxInstances: 10,
capabilities: [
{
Expand Down
Loading