Closed milo-the-dev closed 8 months ago
Hi! Can you paste the stacktrace you see in Neovim? Call :message
to see the whole output.
@wojciech-kulik I've been looking for a way to print that message all morning. Went as far as modifying the code in xcodebuild to send a notification to fidget when the function to install simulator is called smh
here's what I get for the build and run command:
Looks like the problem is caused by an outdated nvim-dap-ui
plugin. Probably:
:lua print(vim.inspect(require("dapui").elements.console))
will fail in your case.
Please try updating plugins using lazy.
Running lua print(vim.inspect(require("dapui").elements.console))
gives me back nil
My current vim-dap-ui
is up to date
Here's the output I get for tests:
Running lua print(vim.inspect(require("dapui").elements.console)) gives me back nil
It shouldn't print nil, I believe. Can you check with nvim-dap-ui configuration from ios-dev-starter?
Just to confirm, are you using Neovim 0.9.5?
Just to confirm, are you using Neovim 0.9.5?
I'll redo my nvim-dap-ui configuration and report back. I was so certain it was the xcodebuild configuration.
Maybe there are more problems, but let's first focus on the obvious one :). The code fails because it is trying to access:
require("dapui").elements.console
but
require("dapui").elements
returns nil
for some reason when you are trying to launch the app.
Maybe you configured nvim-dap-ui to be lazy? And it's not loaded properly for some reason?
Fixed!
Maybe you configured nvim-dap-ui to be lazy? And it's not loaded properly for some reason?
Unfortunately it was simpler than that, I never properly called setup on nvim-dap-ui 🤦🏿♂️
At least it wasn't a total lost of time, I now know of the :message
command.
Thank you so much for the help!
Great to hear! I'm glad you fixed the problem!
@wojciech-kulik might've closed prematurely. Building and running working but my tests are still being skipped and I'm getting this stacktrace
should I reopen or create another ticket?
Could you:
Run tests from Xcode
Go to reports (last tab)
Click on "Logs":
Export logs:
Find a line that looks like Test Case XYZ started
and show me here.
It looks like the plugin is unable to extract class name from this line
Connection has no local endpoint
Test Suite 'All tests' started at 2024-03-05 16:04:07.363.
Test Suite 'UnitTests.xctest' started at 2024-03-05 16:04:07.363.
Test Suite 'AdditionalInfoToDiscountsRXTests' started at 2024-03-05 16:04:07.363.
Test Case '-[UnitTests.AdditionalInfoToDiscountsRXTests testGoodRxPharmacyId]' started.
Test Case '-[UnitTests.AdditionalInfoToDiscountsRXTests testGoodRxPharmacyId]' passed (0.004 seconds).
Test Case '-[UnitTests.AdditionalInfoToDiscountsRXTests testInvalidId]' started.
Test Case '-[UnitTests.AdditionalInfoToDiscountsRXTests testInvalidId]' passed (0.000 seconds).
Test Case '-[UnitTests.AdditionalInfoToDiscountsRXTests testNilGoodPharmacyId]' started.
Test Case '-[UnitTests.AdditionalInfoToDiscountsRXTests testNilGoodPharmacyId]' passed (0.000 seconds).
Test Case '-[UnitTests.AdditionalInfoToDiscountsRXTests testValidId]' started.
Test Case '-[UnitTests.AdditionalInfoToDiscountsRXTests testValidId]' passed (0.000 seconds).
…
The lines you provided are parsed correctly. Probably some other line from logs is causing this problem.
Could you do one test for me?
test.lua
:local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
for _, line in ipairs(lines) do
if string.find(line, "^Test Case.*started%.") then
local target, testClass, testName = string.match(line, "^Test Case .*.%-%[([%w_]+)%.([%w_]+) (%g+)%]")
if not testClass then
print("BUG: " .. line)
else
-- print("Target: " .. target, "Class: " .. testClass, "Test: " .. testName)
end
end
end
:so test.lua
It should print the line which is causing problem.
The logs located under the {project_root}/.nvim/xcodebuild/
?
yes original_logs.log
file
I might be misunderstanding, no luck trying to source the file I created, get an error cannot find file.
Despite the message about test cases looks like the UT are in fact running correctly.
:so file
is relative to your working directory (you can check it by calling :pwd
). So it depends on where you opened your nvim and where you created the file. So it's a matter of pointing to the right file. If you are having problems with your working directory, you can specify an absolute path.
So the issue with tests no longer occurs?
So the issue with tests no longer occurs?
Yeah I'm able to run and get the proper test results. Closing this issue as fixed. Thank you for your time!
Recently I've redone my configuration to clean it up and add support for other languages that I'm working in and upon switching back to iOS I'm unable to run any projects, not even test project. It was working before and when I try your
ios-dev-starter-nvim
config I can run the projects fine.The LSP is working fine and I'm able to run all the Xcodebuild commands so it seems to be wired up properly but when I run tests I get this error and my tests don't run although it installs the app to the simulator and the Test explorer shows When I try to run the app itself the build succeeds but it never launches the application in the booted simulator and I get this from
xcode.lua
It seems all other aspects are working including my integration with other plugins but xcodebuild.nvim is not right and I cannot seem to find the issue. Again I'm able to run these projects as expected if I use the
ios-dev-starter-nvim
config so I don't think it's any thing wrong with the project setup.checkhealth:
running
xcrun simctl launch
passing the bundle id and destination found in the project'ssettings.json
launches the application just fine.Here's my xcodebuild.nvim setup