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

New Feature in empty project not possible #94

Closed
StefanMaron opened this issue Feb 8, 2021 · 6 comments
Closed

New Feature in empty project not possible #94

StefanMaron opened this issue Feb 8, 2021 · 6 comments
Assignees
Labels
bug Something isn't working version A To be picked up right away
Milestone

Comments

@StefanMaron
Copy link

Describe the bug
In an empty Project it is not possible to create new Feature

To Reproduce
Steps to reproduce the behavior:

  1. New Project with al Go!
  2. Create Folder "src"
  3. Open Test Scriptor
  4. change to features

Screenshots
If applicable, add screenshots or videos to help explain your problem.
image

@StefanMaron StefanMaron added the bug Something isn't working label Feb 8, 2021
@lvanvugt lvanvugt assigned lvanvugt and DavidFeldhoff and unassigned lvanvugt Feb 8, 2021
@lvanvugt lvanvugt added this to the beta release milestone Feb 8, 2021
@lvanvugt lvanvugt added the version A To be picked up right away label Feb 8, 2021
@lvanvugt
Copy link
Contributor

lvanvugt commented Feb 8, 2021

@StefanMaron, thanx for finding. This surely needs to get fixed.

Workaround for now
Create a dummy test codeunit with on test, for example:

codeunit 97051 MyCodeunit
{
    Subtype = test;

    trigger OnRun()
    //[FEATURE] Dummy Feature
    begin
    end;

    [Test]
    procedure MyProcedure()
    begin
    end;
}

@martonsagi
Copy link
Collaborator

I've added an empty input box for this case. (Commit message was mistakenly attached to #95 instead of 94)

image

@lvanvugt
Copy link
Contributor

lvanvugt commented Feb 9, 2021

Error occurs in multi-project workspace setting. Works OK in single project workspace.

ENOENT: no such file or directory, open 'c:\Users\lvvugt\source\repos\TestFixtureInitializer\TestFixtureInitializer\src\codeunit\NewFeature.al'

@martonsagi, can we fix this in beta?

@DavidFeldhoff
Copy link
Collaborator

Well, that was an issue on my site, not on martons, so you could have left it on my name 🤣
The issue was that the new test codeunit should be created inside a directory which did not exist.
I'll now create the parent directorys if they're not there yet.

@DavidFeldhoff
Copy link
Collaborator

DavidFeldhoff commented Feb 12, 2021

Let me explain how it's realized yet:
The issue was that I couldn't add the file to a directory which does not exist yet. As explained above, I'll create that directory now if it's not there yet.
But there's another thing that comes into play: To find out which directory it is to store the new files. For that we've our setting "atddTestScriptor.testDirectory" which specifies a relative path. But what is the base for the relative path?
I realized it in this way:

  • If it's a multi-root-workspace, then the path of the *.code-workspace file is taken as base
    -If it's just a folder (or an unsaved *.code-workspace file with only one folder) then that single folder is taken as base
  • Otherwise, if it's a *.code-workspace file which is unsaved yet, then I'll throw an error that the user should save the workspace before creating features. (As it's a hard error by now you've to close the ATDD pane as we're in a blocking mode, so that's not optimal, but you couldn't do anything anyway.

So I think it works for now and the only open topic of this issue is the blocking mode, but I have to handle other errors which I'm throwing in a different way as well, so I'll create another issue for that, I'd suggest.

@lvanvugt
Copy link
Contributor

Tested and OK. No test yet created. Is on to-do list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working version A To be picked up right away
Projects
None yet
Development

No branches or pull requests

4 participants