I have a problem using sasunit Version 1.7 in combination with SAS 9.4.
I have been using sasunit version V1.2.1 with SAS 9.3 to validate a SAS macro. Everything was fine: each test scenario passed and I had a test coverage of 100%. Now I wanted to validate the same SAS Macro with SAS 9.4. I downloaded the sasunit version v1.7. (because the version v1.2.1 does not work with SAS 9.4). There were no errors in the test scenarios, but I had a test coverage of 0%. Using the sasunit version v1.7. in combination with SAS 9.3 to validate the macro, the test coverage was 100%. Any ideas what I can do? Maybe anyone has the same problem?
Thank you!
Martina Kottas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I started the example project of SASUnit v1.7 just to make sure if it is working. In our conitnuous integration environment coverage assessment is functioning properly with v1.7 under SAS9.3 and SAS9.4. It works under windows and linux.
So it seems that this effect is bound to your environment and/or call to sasunit. Perhaps there is an issue with the case of the macro names. They could be handle differently in SAS9.3 and SAS9.4. In the example project of SASUnit we have camel case names to ensure that it is really case insensitive. But there could still be an issue.
What does the test coverage report look like? Is there a report at all?
If there is one the name of the macro could be matched correctly to the macro sources program.
If there is no report then we should check the macro names.
Please add some information so I can investigate further.
Regards
Klaus Landwich
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
please find attached the report for our testscenario. As you can see, the test coverage is 0%. . The testcases for this testscenario all passed. As you can see, we have got names including the underscore, do you think this might be a problem?
The purpose of the app.sas macro is to summarise statistics for clinical study report. This is the "main" macro, invoking different other macros.
What does it mean if the testcoverage for the app.sas unit is 0%, but the testcases for this unit all passed (see 2nd screenshot above)? If I use sasunit 1.7.1 in combination with SAS 9.3 everything is ok. The testcoverage of the app.sas unit is 100%.
I hope this might help you!
Kind Regards,
Martina Kottas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
currently I have no idea how one could get a testcoverage of 0%. Therefore my assumption is that it could be bound to the SAS9.4 version you are using.
What maintenance release do you use?
I tried to create an example that reproduces 0% test coverage. I didn't succeed. If I use multiple macro definition in one source code file then I manage to get low percentage like 27%.
What is true is that there was a change in the result MCOVERAGE creates from SAS9.3 to SAS9.4. So it is reasonable that you get different results.
Currently I cannot reproduce your results and name the circumstances under which it occurs.
Could you share a skeleton of your app.sas like this:
/** Comment header of app.sas */%macroapp(...);<briefdescriptionwhathappens>%mendapp;<othermacrodefinitionsifapplicable>
I just wanna know where this behaviour comes from to perhaps fix an issue with the testcoverage.
Regards
Klaus Landwich
Last edit: Klaus Landwich 2018-03-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
is it possible that your macro definition is split over multiple lines? Like that:
%MACROapp(...);
If the macro name is not on the same line as the macro keyword then SASUnit can't handle that correctly.
Regards
Klaus Landwich
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2018-03-14
Dear Klaus Landwich,
thanks for the suppoort so far. We checked: the macro keyword and the definition is in one line, nothing changed in testcoverage. Regarding your question about the maintenance release, we are using M1. Might this be an issue? May it be possible to send you a skeleton of our app-macro in private? We do not want to share in this forum. Thank you very much.
Regards,
Martina Kottas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I received your e_mail and found out what causes the problem! I can reproduce your 0% test coverage.
This behaviour is caused by the optload procedure call.
I will investigate in it a bit.
My first Idea would be to reset the mcoverage options after proc optload. But I'm not sure if it is that easy.
Another solution would be to skip this optload in the test environment. I know that's not good practise but it would circumvent the problem in the first step.
Regards
Klaus Landwich
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In version 9.4 SAS save more option in PROC OPTSAVE. These includes MCOVERAGE and MCOVAGELOC. SASUnit relies on these options for test coverage.
I have no clue what happens if these options are imported, but there seems to be something wrong.
Without applying a hotfix or using an newer mainetnace release you can use the following work around. Skip those two options when you load the options.
proc optload data=_oldOptions(where=(optname not in ("MCOVERAGE", "MCOVERAGELOC")));
run;
This is a solution that in my opinion is suitable even in an regulated environment.
Regards
Klaus Landwich
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2018-03-19
Dear Klaus Landwich,
thank you so much for your support. It worked out. Using this options we could validate our app macro in SAS 9.4. However, using SAS 9.3 we have other errors with this options. All in all, using SAS 9.4 these options has to be included, using SAS 9.3 we don't need these options!
Thank you very much!
Martina Kottas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "Support Requests" comments posted by this user
Mark all as spam, and block user from posting to "Forum"
Dear All,
I have a problem using sasunit Version 1.7 in combination with SAS 9.4.
I have been using sasunit version V1.2.1 with SAS 9.3 to validate a SAS macro. Everything was fine: each test scenario passed and I had a test coverage of 100%. Now I wanted to validate the same SAS Macro with SAS 9.4. I downloaded the sasunit version v1.7. (because the version v1.2.1 does not work with SAS 9.4). There were no errors in the test scenarios, but I had a test coverage of 0%. Using the sasunit version v1.7. in combination with SAS 9.3 to validate the macro, the test coverage was 100%. Any ideas what I can do? Maybe anyone has the same problem?
Thank you!
Martina Kottas
Dear Martina Kottas,
I started the example project of SASUnit v1.7 just to make sure if it is working. In our conitnuous integration environment coverage assessment is functioning properly with v1.7 under SAS9.3 and SAS9.4. It works under windows and linux.
So it seems that this effect is bound to your environment and/or call to sasunit. Perhaps there is an issue with the case of the macro names. They could be handle differently in SAS9.3 and SAS9.4. In the example project of SASUnit we have camel case names to ensure that it is really case insensitive. But there could still be an issue.
What does the test coverage report look like? Is there a report at all?
If there is one the name of the macro could be matched correctly to the macro sources program.
If there is no report then we should check the macro names.
Please add some information so I can investigate further.
Regards
Klaus Landwich
View and moderate all "Support Requests" comments posted by this user
Mark all as spam, and block user from posting to "Forum"
Dear Klaus Landwich,
please find attached the report for our testscenario. As you can see, the test coverage is 0%.
. The testcases for this testscenario all passed.
As you can see, we have got names including the underscore, do you think this might be a problem?
Regards,
Martina Kottas
Dear Martina Kottas,
yes the test coverage for app.sas is 0%. For the other units under test, as far as they are in the screenshot, there is a test coverage calculated.
So there is no general problem creating a test coverage. I tried to create a scenario with 0% but can't succeeed.
Can you briefly outline in words what happens in app.sas?
Do you redirect log files?
Regards
Klaus Landwich
View and moderate all "Support Requests" comments posted by this user
Mark all as spam, and block user from posting to "Forum"
Dear Klaus Landwich,
first of all, thanks a lot for your help so far.
The purpose of the app.sas macro is to summarise statistics for clinical study report. This is the "main" macro, invoking different other macros.
What does it mean if the testcoverage for the app.sas unit is 0%, but the testcases for this unit all passed (see 2nd screenshot above)? If I use sasunit 1.7.1 in combination with SAS 9.3 everything is ok. The testcoverage of the app.sas unit is 100%.
I hope this might help you!
Kind Regards,
Martina Kottas
Dear Martina Kottas,
currently I have no idea how one could get a testcoverage of 0%. Therefore my assumption is that it could be bound to the SAS9.4 version you are using.
What maintenance release do you use?
I'm using M2.
If you can't see the start up message of SAS9.4 then you can issue the following to get the excat SAS version:
Regards
Klaus Landwich
Dear Klaus Landwich,
we're using M1 (9.04.01M1P120413).
We do have the log files but can't see any warnings etc.
Regards
Martina Kottas
Dear Martina Kottas,
I tried to create an example that reproduces 0% test coverage. I didn't succeed. If I use multiple macro definition in one source code file then I manage to get low percentage like 27%.
What is true is that there was a change in the result MCOVERAGE creates from SAS9.3 to SAS9.4. So it is reasonable that you get different results.
Currently I cannot reproduce your results and name the circumstances under which it occurs.
Could you share a skeleton of your app.sas like this:
I just wanna know where this behaviour comes from to perhaps fix an issue with the testcoverage.
Regards
Klaus Landwich
Last edit: Klaus Landwich 2018-03-09
Dear Martina Kottas,
is it possible that your macro definition is split over multiple lines? Like that:
If the macro name is not on the same line as the macro keyword then SASUnit can't handle that correctly.
Regards
Klaus Landwich
Dear Klaus Landwich,
thanks for the suppoort so far. We checked: the macro keyword and the definition is in one line, nothing changed in testcoverage. Regarding your question about the maintenance release, we are using M1. Might this be an issue? May it be possible to send you a skeleton of our app-macro in private? We do not want to share in this forum. Thank you very much.
Regards,
Martina Kottas
Dear Martina Kottas,
sure you can send me a private message.
Attach the macro or copy it in the body of the message I have no preferences.
Regards
Klaus Landwich
Dear Martina Kottas,
I received your e_mail and found out what causes the problem! I can reproduce your 0% test coverage.
This behaviour is caused by the optload procedure call.
I will investigate in it a bit.
My first Idea would be to reset the mcoverage options after proc optload. But I'm not sure if it is that easy.
Another solution would be to skip this optload in the test environment. I know that's not good practise but it would circumvent the problem in the first step.
Regards
Klaus Landwich
Dear Martina Kottas,
I have a solution to your problem.
In version 9.4 SAS save more option in PROC OPTSAVE. These includes MCOVERAGE and MCOVAGELOC. SASUnit relies on these options for test coverage.
I have no clue what happens if these options are imported, but there seems to be something wrong.
Without applying a hotfix or using an newer mainetnace release you can use the following work around. Skip those two options when you load the options.
This is a solution that in my opinion is suitable even in an regulated environment.
Regards
Klaus Landwich
Dear Klaus Landwich,
thank you so much for your support. It worked out. Using this options we could validate our app macro in SAS 9.4. However, using SAS 9.3 we have other errors with this options. All in all, using SAS 9.4 these options has to be included, using SAS 9.3 we don't need these options!
Thank you very much!
Martina Kottas