Skip to content

[Failing test] TFS2018 task.setvariable issue with isOutput #2426

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

Closed
michal-ciechan opened this issue Oct 17, 2020 · 1 comment
Closed

[Failing test] TFS2018 task.setvariable issue with isOutput #2426

michal-ciechan opened this issue Oct 17, 2020 · 1 comment

Comments

@michal-ciechan
Copy link

Hey, we are still using an on prem TFS 2018 and latest code which outputs 2 sets of set parameters breaks because of the isOutput=true. We get the following error.

Output variable value cannot be null

This causes the task to fail.

Currently worked around it with a flag [AzurePipelinesSetParamSkipIsOutput] in a custom version of GitVersion. (Will raise another Issue as to why).

Happy to do the work for whatever flag/method of allowing user to skip the isOutput=true message.

IMHO I think it should be a flag we can pass rather than a ENV variable we set. (Setting custom env vars would need a separate build step in the build pipeline, where as a flag can be easily added to the existing build step)

I have checked our Env variables and unfortunately I could not find any Build Server / TFS version other than Build Agent Version, but not sure which versions it affects.

Test code

See Code michal-ciechan/GitVersion at feature/TFS2019-output-vars-issue.

[Test]
public void GenerateSetParametersShouldNotAddIsOutputIfSkipFlagIsSet()
{
    //TODO: Set Flag (TBD)
    var vsVersion = buildServer.GenerateSetParameterMessage("Foo", "Bar");

    vsVersion.ShouldContain("##vso[task.setvariable variable=GitVersion.Foo]Bar");
    vsVersion.ShouldNotContain(x =>x.Contains("isOutput", StringComparison.OrdinalIgnoreCase));
}
@michal-ciechan
Copy link
Author

michal-ciechan commented Oct 17, 2020

Could change the assert to be

vsVersion.Single().ShouldNotContain("isOutput");

Whichever you prefer.

@michal-ciechan michal-ciechan changed the title [Failing test]TFS2018 task.setvariable issue with isOutput [Failing test] TFS2018 task.setvariable issue with isOutput Oct 17, 2020
@arturcic arturcic closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants