go to post Michael Davidovich · Apr 11, 2022 For other n00bs like me . . . in GitHub you click the Releases link on the code page and you can find the packaged code.
go to post Michael Davidovich · Apr 11, 2022 I have implemented @Dmitry.Maslennikov's solution below, but I wonder @Nigel Salm if you'd had success with any of those extensions to specify pages to open in browsers. If you search the extension library for "open in browser" many, many options come up but they all seem to focus on HTML pages.
go to post Michael Davidovich · Apr 6, 2022 Ah ok, so just onClick=return fromAJavaScriptFunction()? Define that in <script language="javascript">, right? Returning 0 on the server-side method didn't seem to stop the form, my file was still generated from the process that runs after checking the %reqeust.Data("sumbitButton",1) node. But I think I'll get rid of this anyway. <script language="Cache" method="Validate" arguments="startDate:%Date,endDate:%Date"> s startDate=$ZDH(startDate,3) s endDate=$ZDH(endDate,3) if startDate>endDate { &js< alert('Invalid date range.');> quit 0 } quit 1 </script> I turned on that auditing btw and I'm not seeing anything. But doing some other debugging it seems that the %Net.SMTP.Send() method is getting hung up. If I step through it, it's endless lines of code. I put a break after the Send() method and it never reaches it. Not sure if it's infinite looping or just getting hung.
go to post Michael Davidovich · Apr 6, 2022 @Timothy Leavitt thank you! I wouldn't have thought to do form logic OnPreHttp . . . the documentation suggests checking the %request.Data node for the form in the runat="server" script. This does make sense if you plan to do a redirect, I think. Thank you for helping me better understand the runat="server" timing. It's been a while since I've touched PHP but this all rings a bell.
go to post Michael Davidovich · Apr 6, 2022 @Warlin Garcia thank you! In fact, I'm doing something like this but I must be missing something. Form has an attribute: onSubmit="return #server(..Validate(date1,date2))#" Validate() is in the CSP code as such: <script language="Cache" method="Validate" arguments="startDate:%Date,endDate:%Date"> s startDate=$ZDH(startDate,3) s endDate=$ZDH(endDate,3) if startDate>endDate { &js< alert('Invalid date range.'); return false;> } </script> I get my alert, but my page continues to reload, which would be fine I guess, but the %request.Data object with the data from the form is still populated. So when the following block runs, the process that I don't want to execute on the server side keeps going when I want it to not run. I guess I'm not sure what returning false to the onSubmit actually does? What is does not seem to do is clear or not set the %request.Data form nodes. <script language="Cache" runat="server"> If ($Data(%request.Data("FormThatWasSubmitted",1))) { s startdate=%request.Data("STARTDATE",1) s startdate=$ZDH(startdate,3) s enddate=%request.Data("ENDDATE",1) s enddate=$ZDH(enddate,3) job process^routine(startdate, enddate) </script> Side note: I'm jobbing off that routine which sends and email . . . if I do the job in the foreground with a DO the email sense, if I use JOB the email does not send (file still generates). Anyone know why?
go to post Michael Davidovich · Apr 5, 2022 I guess more generally, I'm not sure when using this tag is supposed to be used: <script language="Cache" runat="server"> It's clearer when to use: <script language="cache" method="OnPreHTTP">> <script language="Cache" method="SomeMethod"> If I move my code from the tag with the runat="Server" argument, then I can't seem to access the %request.Data object. If I keep my code in that block, I can't use any &js<> syntax. Can someone explain in a kindergarten way to me where this lives in the HTTP lifecycle?
go to post Michael Davidovich · Apr 4, 2022 So I originally installed the scatter plot plugin from the library, not the one from your repo. I uninstalled that and I'm trying to install the one you modified. I'm having a little trouble because it seems I have to download your source, make sure I have a JDK installed and Maven and package the code into a .hpi file? Does this sound right? I'm getting some issues with the POM file while running 'mvn pacakge'. Is it possible to provide the packaged file for those of us not Java-savvy?
go to post Michael Davidovich · Apr 1, 2022 I think this is it: GitHub - timleavitt/covcomplplot-plugin: Jenkins covcomplplot pluginIt's written by Tim, it's on the plugin library, and it looks like what was in the presentation, however I have some more digging come Monday.
go to post Michael Davidovich · Apr 1, 2022 For those following along, I got this to work finally by creating the "coverage.list" file in the unit test root. I tried setting the parameter node "CoverageClasses" but that didn't work (maybe I used $LB wrong). Still not sure how to get the scatter plot for complexity as @Timothy Leavitt mentioned in the presentation the Cobertura plugin was customized. Any thoughts on that are appreciated!
go to post Michael Davidovich · Mar 31, 2022 Trial and error folks: @Timothy Leavitt your presentation mentioned a custom version of the Coberutra plugin for the scatter plot . . . is that still necessary or does the current version support that? Not sure if I see any mention of the custom plugin on the GitHub page. Otherwise, I seem to me missing something key: I don't have build logic in my script. I suppose I just thought that step was for automation purposes so that the latest code would be compiled on whatever server. I don't have anything like that yet and thought I could just run the test coverage utility but it's coming up with nothing. I'll keep playing tomorrow but appreciate anyone's thoughts on this especially if you've set it up before!
go to post Michael Davidovich · Mar 31, 2022 I had to go back . . . that was a custom class and method that was written for the Widgets Direct demo app.
go to post Michael Davidovich · Mar 31, 2022 Not sure if this is right, but I created a new IRIS user and then created delegated access to %Service_Console and included this in my ZAUTHENTICATE routine. Seems to have worked. Now . . . on to the next problem: DO ##CLASS(UnitTest.Manager).OutputResultsXml("junit.xml") ^ <CLASS DOES NOT EXIST> *UnitTest.Manager
go to post Michael Davidovich · Mar 31, 2022 @Timothy Leavitt and others: I know this isn't Jenkins support, but I seem to be having trouble allowing the account running Jenkins to get into IRIS. Just trying to get this to work locally at the moment. I'm running on Windows through an organizational account, so I created a new local account on the computer, jenkinsUser, which I'm to understand is the 'user' that logs in and runs everything on Jenkins. When I launch IRIS in the build script using . . . C:\MyPath\bin\irisdb -s C:\MyPath\mgr -U MYNAMESPACE 0<inFile . . . I can see in the console it's trying to login. I turned on O/S authentication for the system and allowed the %System.Login function to use Kerbose. I can launch Terminal from my tray and I'm logged in without a user/password prompt. I am guessing that IRIS doesn't know about my jenkinsUser local account, so it won't allow that user to us O/S authentication? I'm trying to piece this together in my head. How can I allow this computer user trying to run Jenkins access to IRIS without authentication? Hope this helps others who are trying to set this up.
go to post Michael Davidovich · Mar 31, 2022 Thanks, @Timothy Leavitt! For others working through this too, I wanted to sum some points up that I discussed with Tim over PM. - Tim reiterated the usefulness of the Test Coverage tool and the Cobertura output for finding starting places based on complexity and what are the right blocks to test. - When it comes to testing persistent data classes, it is indeed tricky but valuable (e.g. data validation steps). Using transactions (TSTART and TROLLBACK) is a good approach for this. I also discussed the video from some years ago on the mocking framework. It's an awesome approach, but for me, it depends on retooling classes to fit the framework. I'm not in a place where I want to or can rewrite classes for the sake of testing, however this might be a good approach for others. There may be other open source frameworks for mocking available later. Hope this helps and encourages more conversation! In a perfect world we'd start with our tests and code from there, but well, the world isn't perfect!
go to post Michael Davidovich · Mar 30, 2022 @Timothy Leavitt Do you all still use your Test Coverage Tool at InterSystems? I haven't seen any recent updates to it on the repo so I I'm wondering if you consider it still useful and it's just in a steady state, stable place or are there different tactics for test coverage metrics since you published?
go to post Michael Davidovich · Mar 15, 2022 Does 'irissession' take any additional args like username and password?
go to post Michael Davidovich · Feb 25, 2022 Thanks @Robert Cemper I think I'm good! I was working on that quite a long time ago and I know a little bit more about Docker and IRIS now. I appreciate you checking in.
go to post Michael Davidovich · Feb 3, 2022 I'm helping maintain a fairly old code base that wasn't built around test-driven development. I know debugging and testing are two different things, but I often find that the only way to test my code is to use the debugger. If I had better ways of stepping and out of entry points to automate these tests it would be great, but the debugger doesn't work like that. Does anyone else find that their unit testing is also using the debugger?
go to post Michael Davidovich · Jan 18, 2021 I have followed these steps both from the GitHub readme file and this more detailed article and I'm having an issue. To start, however, know I was able to follow the instructions on the the DockerHub page for IRIS and I got my container running and VS Code connected and working. Since I got that working, I decided to better understand starting with this template. I downloaded the objectscript-docker-template from GitHub to my local drive K:\objectscript-docker-template. I ran the commands to install and run the IRIS container in Git Bash and I see it running in Docker Desktop. I can go in the container's command line and type 'iris TERMINAL IRIS' and I'm brought to the USER namespace. Back in the project location, I run 'docker-compose up -d' and I get a series of errors: $ docker-compose up -dCreating objectscript-docker-template_iris_1 ... error ERROR: for objectscript-docker-template_iris_1 Cannot create container for service iris: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled","StackTrace":" at Docker.ApiServices.Mounting.FileSharing.<DoShareAsync>d__6.MoveNext() in C:\\workspaces\\stable-2.3.x\\src . . . It goes on and on so I won't paste the whole thing. If I stop the Docker container it's also deleted. Has anyone had a similar issue or can see right off the bat what I might be doing wrong? Thanks, Mike
go to post Michael Davidovich · Jan 13, 2021 I see below that you've asked Raj to get a webinar going, so I will look forward to that! I think I'm just getting bogged down in terms. You said that server-side dev is the only option IRIS provides, but so far what I've experienced is that I can edit a .CLS or .MAC file in my local workspace and then on save it's sent to the server (the container running IRIS) and compiled. Now that I've saved that file and it's on the server, to continue making changes I should open up the server-side file and continue editing from there? Or I can continue working on the local and it will overwrite the sever side? I think I'm seeing your point about commits then. I edit it locally, it's sent to the server, the server sends it to the repo, and locally I should pull down the repo before continuing any changes. Is that the idea? The development lifecycle and source control at my work doesn't utilize modern source control (git) and it's my first programming job (no context elsewhere), so it takes me a while to grasp some of these things :)