jenkinsci / salesforce-migration-assistant-plugin

Salesforce Migration Assistant plugin for Jenkins CI
https://plugins.jenkins.io/salesforce-migration-assistant-plugin/
MIT License
29 stars 15 forks source link

Getting null pointer exception while consuming Salesforce Migration assistant plugin in Jenkins #31

Open Ved-Prakash-Coforge opened 3 years ago

Ved-Prakash-Coforge commented 3 years ago

Version report

Jenkins and plugins versions report:

Salesforce Migration assistant version: v2.2.2
Windows operating system

Reproduction steps

  1. Created freestyle project and added git repo. image image

  2. Given org. details to setup salesforce migration assistant image

  3. while running the project in Jenkins getting below error [Checks API] No suitable checks publisher found. java.lang.NullPointerException at org.jenkinsci.plugins.sma.SMARunner.(SMARunner.java:71) at org.jenkinsci.plugins.sma.SMABuilder.perform(SMABuilder.java:65) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:806) at hudson.model.Build$BuildExecution.build(Build.java:198) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:514) at hudson.model.Run.execute(Run.java:1888) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:431)

Build step 'Salesforce Migration Assistant' marked build as failure [Checks API] No suitable checks publisher found. Finished: FAILURE image

Results

Expected result: it's should connected to the Salesforce Org. to deploy delta changes in the source using Jenkins

Actual result: Null pointer exception is coming as mentioned under point 3

hlopetz commented 3 years ago

check #19

Ved-Prakash-Coforge commented 3 years ago

check #19

Thanks hlopetz for the quick response,

I used the latest release 3.0 and now Null pointer exception is not coming but when I am running the job then nothing is deploying in the org. check below screens for reference.

Screen 1: Empty deployment is happening

image

Screen 2: Console Output

image

hlopetz commented 3 years ago

tbh, i personally got rid of the plugin usage and set Jenkins up with sfdx command. so i cannpt help you further, sorry.

the shell script i use is

TIMEOUT=120

/usr/local/bin/sfdx force:org:list --all --verbose
export SFDX_IMPROVED_CODE_COVERAGE='true'
/usr/local/bin/sfdx force:apex:test:run \
    --targetusername Full \
    --resultformat junit \
    --outputdir . \
    --codecoverage \
    --testlevel RunLocalTests \
    --wait $TIMEOUT \
    --verbose 2> error.log > run.log || exit 0
echo echo error log:
cat error.log

that setup does not deploy a specific revision, but runs a build on a sandbox i need to check every night to control if admins made a change which broke anything. i have the same for production instance.

hlopetz commented 3 years ago

but you can adapt the script above to deploy a specific package/revision to a scratch org and run the tests you like.