-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Automatic capture of relevant Test classes or any Dependencies in package.xml when Apex classes are Updated #241
Comments
Hi @akshay4570 ! Thanks for this suggestion ! From what I understand, you need to be able to generate the I think we got you covered 😉 , We explained a way to parse Generate a comma-separated list of the added and modified Apex classes in our README.md. You may want to do something for the test classes already present in the package.xml because they also will be postfix here. |
Hi @scolladon, |
I think this is what I proposed... What you are suggesting is a little bit more smarter from what I understand.
I think it could be done pretty easily using the Dependency API and/or Tooling API symbol table If that's what you have in mind, then I think it is a great idea, and I think this plugin may not be the right place to deal with that kind of problem. |
Hi @akshay4570 and thank you for taking the time to describe your enhancement! In addition to the answers from @scolladon, I would add that dealing with this kind of dependency tree is not trivial. For example, I'm not sure how we would identify the relevant Test classes that apply to a modified Apex class? Naming conventions (will not always work)? Downstream dependency (will not always work either, at least not if we limit the depth)? You also mention upstream dependencies, but if an SObject is not modified in the repo, I do not see the rationale for adding it just because it's referenced in a test class. What would be the reason for adding that dependency to the package? So I'm afraid it would be hard to find a solution that fit everyone's needs in a reliable way. For now I would close this issue, but please let us know if you feel that we missed your point! |
Hello, I am trying to implement a CI/CD using SFDX cli. I found your very nice plugin to create a package.xml with only changes for source to target branch which is exactly what I need. Could you please provide the environment you are running this command ? is that a linux ubuntu as well ? |
Hi @tetardv, Personally I'm on mac. In order to install xq, you need to install yq. |
Hi @scolladon , I will share my dockerfile if it can be of any help for anyone : ENV DEBIAN_FRONTEND=noninteractive RUN echo '95bdaaf92265eefd40d2055fb9b5cd6cbc3cb2c4495e3ebd4b1b501822d69731 ./nodejs.tar.gz' > node-file-lock.sha ENV PATH=/usr/local/lib/nodejs/bin:$PATH RUN echo y | sfdx plugins:install sfdx-git-delta RUN apt-get update && apt-get install --assume-yes openjdk-11-jdk-headless jq python3-pip python3.5 RUN pip install yq ENV SFDX_CONTAINER_MODE true Thanks ! |
Is your proposal related to a problem?
Hi Team,
Git Delta is a great product and have been using it for quit a while but to run
RunSpecifiedTests
with only the Testcases that are relevant to a particular Apex class which is changed rather than running all the test classes there seems to be no option. Could it be possible to pick all the dependencies including Test classes, Objects etc. to be picked as part of package.xml when there is any updated Apex Class.Describe the solution you'd like
Lets say I have a class
ApexClass1
and it has a dependency over an ObjectObject1
and TestclassApexClass1_Test
. The solution I would like is whenever there is changes on theApexClass1
file the dependencies likeObject1, ApexClass1_Test
should also be captured in the package.xml so that we can run a script and loop through these files and run only the specified test cases.By updating
ApexClass1
the package.xml should look like this,Describe alternatives you've considered
Till now, I am not able to find a way to capture the dependencies.
Additional context
The text was updated successfully, but these errors were encountered: