Error running maven tests on jsonix - how to debug? - jsonix

I have just downloaded jsonix and when I run maven it fails its built-in tests, with the following error:
FAILURES: 2/898 assertions failed (332ms)
npm ERR! Test failed. See above for more details.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Jsonix 2.4.2-SNAPSHOT:
[INFO]
[INFO] Jsonix ............................................. SUCCESS [ 0.698 s]
[INFO] Jsonix Scripts ..................................... SUCCESS [ 9.933 s]
[INFO] Jsonix Node.js ..................................... SUCCESS [ 0.014 s]
[INFO] Jsonix Node.js Scripts ............................. FAILURE [ 4.296 s]
[INFO] Jsonix Node.js Tests ............................... SKIPPED
...etc other skipped tests omitted
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
I really don't know my way around maven very well, and despite the "see above for more details" message, I don't actually see any details that can help me debug this.
Any suggestions on how to debug or fix this would be much appreciated.

Please use Jsonix issue tracker to ask project-specific question.
Check pom.xml of the failing scripts module:
<execution>
<id>npm-test</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
So apparenty Maven simply executes npm test in the test phase. You can, too:
jsonix/nodejs/scripts> npm test
> jsonix#2.4.2-SNAPSHOT test ...\jsonix\nodejs\scripts
> nodeunit tests/tests.js
...
√ Jsonix - Issues - Issues - GH96 - Standard - Roundtrips - test_any.xml
Testing [...\jsonix\nodejs\scripts\tests\GH96/test_any].
√ Jsonix - Issues - Issues - GH96 - Standard - Comparisons - test_any.xml
√ Jsonix - Issues - Issues - GH111 - MarshallsWithPrefix
√ Jsonix - Issues - Issues - GH135 - A_B
√ Jsonix - Issues - Issues - GH135 - B_A
√ Jsonix - Issues - Issues - GH141 - DurationP
√ Jsonix - Issues - Issues - GH150 - A_B
√ Jsonix - Issues - Issues - GH150 - B_A
OK: 898 assertions (696ms)
If some tests are failing you can redirect the output to files (npm test >std.log 2>err.log) and check which tests are failing.
Please file issues so this will be fixed.
At the moment I can't reproduce this, the build is green on my local machine.
Disclaimer: I'm the author of Jsonix.

Related

Building Iac scanning pipeline in gitlab encountered problems

I am trying to use Infrastructure as Code (IaC) Scanning scans my IaC configuration files for known vulnerabilities. Reference: https://docs.gitlab.com/ee/user/application_security/iac_scanning/. However, I encountered the system problem in the pipeline.
[DEBU] [kics] [2022-11-11T03:55:29Z] [/go/pkg/mod/gitlab.com/gitlab-org/security-products/analyzers/command#v1.9.2/run.go:256] ▶ SAST_EXCLUDED_PATHS=spec,test,tests,tmp39
[INFO] [kics] [2022-11-11T03:55:29Z] [/go/pkg/mod/gitlab.com/gitlab-org/security-products/analyzers/command#v1.9.2/run.go:131] ▶ Detecting project
[INFO] [kics] [2022-11-11T03:55:29Z] [/go/pkg/mod/gitlab.com/gitlab-org/security-products/analyzers/command#v1.9.2/run.go:153] ▶ Analyzer will attempt to analyze all projects in the repository41
[INFO] [kics] [2022-11-11T03:55:29Z] [/go/pkg/mod/gitlab.com/gitlab-org/security-products/analyzers/command#v1.9.2/run.go:165] ▶ Running analyzer42
[DEBU] [kics] [2022-11-11T03:55:29Z] [/go/src/app/analyze.go:48] ▶ custom rulesets not enabled
[INFO] [kics] [2022-11-11T03:55:29Z] [/go/src/app/analyze.go:67] ▶ path /builds/leo/tcf
[ERRO] [kics] [2022-11-11T03:55:38Z] [/go/src/app/analyze.go:87] ▶ Encountered a system problem; status code: 2, error: exit status 2, detail:
[FATA] [kics] [2022-11-11T03:55:38Z] [/go/src/app/main.go:30] ▶ kics scanner failure: exit status 2
Uploading artifacts for failed job00:0048Uploading artifacts...
WARNING: gl-sast-report.json: no matching files. Ensure that the artifact path is relative to the working directory
ERROR: No files to upload
Cleaning up project directory and file based variables00:0154ERROR: Job failed: exit code 1
I can't find relevant information about the errors. How can I solve the errors?
You can use your own config, independent of the GitLab template.
gitlab-ci.yml:
image:
name: checkmarx/kics:latest
entrypoint: [""]
script:
- kics scan -q /app/bin/assets/queries -p ${PWD} --ignore-on-exit all --report-formats glsast -o ${PWD} --output-name kics-results
artifacts:
reports:
sast: gl-sast-kics-results.json
when: always

Gitlab SAST failed with no visible reason

I'm testing the SAST functionnality provided automatically by Gitlab.
My project (java, spring boot, maven) compiles well locally with mvn clean package.
I'm working with a hosted Gitlab and shared runners.
CI wasn't implemented yet.
I chose the generated .gitlab-ci.yml file
stages:
- test
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml
And then, the job fails with a message like :
$ /analyzer run
[INFO] [Find Security Bugs] [2021-11-01T16:27:54Z] ▶ GitLab Find Security Bugs analyzer v2.28.7
[INFO] [Find Security Bugs] [2021-11-01T16:27:54Z] ▶ Detecting project
[INFO] [Find Security Bugs] [2021-11-01T16:27:54Z] ▶ Found project in /builds/myrepo/myproject
[INFO] [Find Security Bugs] [2021-11-01T16:27:54Z] ▶ Running analyzer
[INFO] [Find Security Bugs] [2021-11-01T16:27:54Z] ▶ Found Mvnw project in /builds/myrepo/myproject directory
[INFO] [Find Security Bugs] [2021-11-01T16:27:54Z] ▶ Found 1 analyzable projects.
[INFO] [Find Security Bugs] [2021-11-01T16:27:54Z] ▶ Building Mvnw project at /builds/myrepo/myproject.
[ERRO] [Find Security Bugs] [2021-11-01T16:29:08Z] ▶ Project couldn't be built: exit status 1
[FATA] [Find Security Bugs] [2021-11-01T16:29:08Z] ▶ exit status 1
How can I know what went wrong ?
The error is in the second to last line of the container:
[ERRO] [Find Security Bugs] [2021-11-01T16:29:08Z] ▶ Project couldn't be built: exit status 1
[FATA] [Find Security Bugs] [2021-11-01T16:29:08Z] ▶ exit status 1
Assuming that your maven job is building fine locally, and it's building fine in a different maven container, I'd suggest that you configure the logging on the SAST job using the logging levels defined in the documentation, and gather some additional information: https://docs.gitlab.com/ee/user/application_security/sast/#logging-level

Override Maven's download of a 3rd party software with a local copy?

I am running the 32-bit build of Ubuntu 18.04 and attempting to build a 32-bit Jenkins from the source.
It fails in the last stage (see below) because it cannot find a Linux x86 build of Nodejs. They don't make 32-bit versions for Linux anymore. I'm fine with that - I have downloaded the 14.15.4 Nodejs sources and built my own 32-bit version. How can I override the Jenkins maven build that is attempting to download a non-existent package directly from the Nodejs distribution site?
I have tried prepositioning my home-built node-14.15.4-linux-x86.tar.gz in the appropriate location, but the build is getting killed because the package does not exist on the website it is attempting to download from (404 - Not Found). If I could stop it trying to download or tell it to pull the .tar.gz package from the local filesystem, I think that should fix the problem. I haven't found anything online and maven configurations are completely foreign to me.
[INFO] Installing node version v14.15.4
[INFO] Downloading https://nodejs.org/dist/v14.15.4/node-v14.15.4-linux-x86.tar.gz to /home/scott/.m2/repository/com/github/eirslett/node/14.15.4/node-14.15.4-linux-x86.tar.gz
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Jenkins main module 2.275-SNAPSHOT:
[INFO]
[INFO] Jenkins main module ................................ SUCCESS [ 4.868 s]
[INFO] Jenkins BOM ........................................ SUCCESS [ 0.156 s]
[INFO] Jenkins cli ........................................ SUCCESS [ 10.285 s]
[INFO] Jenkins core ....................................... SUCCESS [01:12 min]
[INFO] Jenkins war ........................................ FAILURE [ 4.536 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:35 min
[INFO] Finished at: 2021-01-08T00:47:30-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.0:install-node-and-yarn (install node and yarn) on project jenkins-war: Could not download Node.js: Got error code 404 from the server. -> [Help 1]

Connecting Blob to Spark failing

I am trying to connect spark coming in Hortonworks 2.4 distribution to Azure Blob storage and I was getting error "wasb filesystem not recognized " . I checked and many suggested downloading azure-sdk-for-java and creating package.
I am trying to create package using mvn but while running both mvn test and mvn package ; the process is getting hanged while testing. There is no error given , it just failed to return anything. I had changed testconfiguration.xml to reflect my blob account name. Below is the log files I am getting.
Is there something else that needs to be done to get jars ?
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Microsoft Azure Storage Client SDK 4.3.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # azure-storage ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/adminhorton/kspark/azure-storage-java-master/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # azure-storage ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # azure-storage ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # azure-storage ---
[INFO] Compiling 52 source files to /home/adminhorton/kspark/azure-storage-java-master/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.13:test (default-test) # azure-storage ---
[INFO] Surefire report directory: /home/adminhorton/kspark/azure-storage-java-master/target/surefire-reports
T E S T S
parallel='classes', perCoreThreadCount=true, threadCount=2, useUnlimitedThreads=false
Running com.microsoft.azure.storage.StorageAccountTests
Tests run: 33, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.057 sec
Running com.microsoft.azure.storage.StorageUriTests
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.071 sec
com.microsoft.azure.storage.StorageAccountTests.txt
com.microsoft.azure.storage.StorageUriTests.txt
com.microsoft.azure.storage.StorageAccountTests.txt
com.microsoft.azure.storage.StorageUriTests.txt
According to your description, I am not sure you have configured your Storage Configuration rightly in your project. So I recommend you can follow these steps to check your configurations:
1.Create your Azure storage Account and set it in core-site.xml as this format:
<property>
<name>fs.azure.account.key.youraccount.blob.core.windows.net</name>
<value>YOUR ACCESS KEY</value>
</property>
2.Restart the HDP service and use the Hadoop fs –ls wasb://**.blob.core.windows.net/ to list the files in the container.
I strongly recommend you can refer to this blog how-to-configure-hortonworks-hdp-to-access-azure-windows-storage and official document.
Meanwhile , #Yuval provided the great sample about how to connect to Azure blob with Java SDK.

Neo4j build failing on Mac

I cloned master Neo4j on Github and tried to build it:
mvn clean install -DfullBuild -Dlicense.skip=true
Result:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Neo4j .............................................. SUCCESS [ 1.917 s]
[INFO] Neo4j - Licensing configuration .................... SUCCESS [ 0.769 s]
[INFO] Neo4j - Primitive Collections ...................... SUCCESS [ 43.278 s]
[INFO] Neo4j - IO ......................................... SUCCESS [01:50 min]
[INFO] Neo4j - CSV reading and parsing .................... SUCCESS [ 5.461 s]
[INFO] Neo4j - Graph Database Kernel ...................... SUCCESS [03:59 min]
[INFO] Neo4j - JMX support ................................ SUCCESS [ 7.138 s]
[INFO] Neo4j - Usage Data Collection ...................... SUCCESS [ 10.788 s]
[INFO] Neo4j - Monitor Logging ............................ SUCCESS [ 7.750 s]
[INFO] Neo4j - Graphviz generation ........................ SUCCESS [ 7.947 s]
[INFO] Neo4j - Lucene Index ............................... SUCCESS [01:45 min]
[INFO] Neo4j - Graph Algorithms ........................... SUCCESS [ 11.222 s]
[INFO] Neo4j - Graph Matching ............................. SUCCESS [ 7.938 s]
[INFO] Neo4j - Community Cypher Build ..................... SUCCESS [ 3.658 s]
[INFO] Neo4j - Cypher Compiler 2.2 ........................ SUCCESS [04:34 min]
[INFO] Neo4j - Cypher ..................................... SUCCESS [04:29 min]
[INFO] Neo4j - Consistency Checker ........................ SUCCESS [01:10 min]
[INFO] Neo4j - Community .................................. SUCCESS [02:22 min]
[INFO] Neo4j - Community .................................. SUCCESS [ 0.079 s]
[INFO] Neo4j - Generic shell .............................. SUCCESS [01:19 min]
[INFO] Neo4j - Import Command Line Tool ................... SUCCESS [ 31.435 s]
[INFO] Neo4j - Examples ................................... SUCCESS [ 34.906 s]
[INFO] Neo4j - Server API ................................. SUCCESS [ 7.443 s]
[INFO] Neo4j - Browser .................................... SUCCESS [ 57.323 s]
[INFO] Neo4j - Server ..................................... SUCCESS [04:31 min]
[INFO] Neo4j - Test Harness ............................... SUCCESS [ 26.720 s]
[INFO] Neo4j - Server Plugin Tests ........................ SUCCESS [ 14.821 s]
[INFO] Neo4j - Server Examples ............................ SUCCESS [ 25.881 s]
[INFO] Neo4j - UDC Integration ............................ SUCCESS [ 10.245 s]
[INFO] Neo4j - GraphGist .................................. SUCCESS [ 27.983 s]
[INFO] Neo4j - Cypher Documentation ....................... SUCCESS [01:42 min]
[INFO] Neo4j - Cypher Reference Card Tests ................ SUCCESS [ 27.326 s]
[INFO] Neo4j - Community Build ............................ SUCCESS [ 0.077 s]
[INFO] Neo4j - Graph DB Monitoring and Management tools ... SUCCESS [ 10.148 s]
[INFO] Neo4j - Advanced ................................... SUCCESS [ 8.685 s]
[INFO] Neo4j - Advanced Server ............................ SUCCESS [ 21.165 s]
[INFO] Neo4j - Advanced Build ............................. SUCCESS [ 0.064 s]
[INFO] Neo4j - Query Logging .............................. SUCCESS [ 8.720 s]
[INFO] Neo4j - Communication Package ...................... SUCCESS [ 18.359 s]
[INFO] Neo4j - Clustering Infrastructure .................. SUCCESS [ 25.807 s]
[INFO] Neo4j - Backup Tool ................................ SUCCESS [01:22 min]
[INFO] Neo4j - High Availability .......................... SUCCESS [24:19 min]
[INFO] Neo4j - Enterprise ................................. SUCCESS [ 10.279 s]
[INFO] Neo4j - Enterprise Server .......................... SUCCESS [07:02 min]
[INFO] Neo4j - Enterprise Performance Tests ............... SUCCESS [ 41.132 s]
[INFO] Neo4j - Enterprise Build ........................... SUCCESS [ 0.056 s]
[INFO] Neo4j - Integration Tests .......................... SUCCESS [ 49.037 s]
[INFO] Neo4j - Page Cache Stress Tests .................... SUCCESS [ 0.097 s]
[INFO] Neo4j Javadocs ..................................... SUCCESS [ 9.582 s]
[INFO] Neo4j Cypher Reference Card ........................ SUCCESS [ 42.708 s]
[INFO] Neo4j - Reference Manual Contents .................. SUCCESS [ 4.565 s]
[INFO] Neo4j - Reference Manual ........................... SUCCESS [09:49 min]
[INFO] Neo4j - Server Assembler ........................... SUCCESS [ 1.083 s]
[INFO] Neo4j Community - Server Assembler ................. SUCCESS [ 5.669 s]
[INFO] Neo4j Advanced - Server Assembler .................. SUCCESS [ 5.255 s]
[INFO] Neo4j Enterprise - Server Assembler ................ SUCCESS [ 5.249 s]
[INFO] Neo4j Desktop ...................................... SUCCESS [ 51.900 s]
[INFO] Neo4j Packaging Build .............................. SUCCESS [ 0.049 s]
[INFO] Neo4j Debian Installers ............................ FAILURE [ 4.538 s]
[INFO] Neo4j RPM Installers ............................... SKIPPED
[INFO] Neo4j Community RPM ................................ SKIPPED
[INFO] Neo4j Advanced RPM ................................. SKIPPED
[INFO] Neo4j Community RPM ................................ SKIPPED
[INFO] Neo4j Linux Installers ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:22 h
[INFO] Finished at: 2015-02-27T19:37:24+00:00
[INFO] Final Memory: 308M/493M
[INFO] -----------------------------------------------------------------------
I want to build community installer/package for mac which I assume is the last on the list above (Neo4j Linux Installers) but is skipped because of the Debian Installers failure, because it can't find 'debuild' command. What is best way to resolve this?
I have found out that the missing command is used to build Debain packages but can't find a way to install it on my Mac.
Not familiar with mavern; is there a way to exclude the Debian and possibly RPM Installers from the build on my Mac, if Linux installer does not depend on these.
Inside of neo's pom.xml you'll see this:
<profile>
<id>neo-full-build</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>fullBuild</name>
</property>
</activation>
<modules>
<module>manual</module>
<module>packaging</module>
<module>packaging/installer-linux</module>
</modules>
<properties>
<attach-docs-phase>verify</attach-docs-phase>
</properties>
</profile>
You see that bit where it includes <module>packaging/installer-linux</module>? The debian installer package is underneath of that. If you remove that line, I believe the full build will not descend into that directory, attempt to build a debian package (or any other linux, e.g. redhat RPM).

Resources