Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartaee-platform-dev] Running TCK

Hi,

The issue is perhaps that there are a few different guides floating around, that all look deceptively simple but aren't always that simple when things don't work as they are supposed to. They also all somewhat give different steps.

The easiest way is perhaps to look at the jobs that we have running to run the individual TCKs, as they start with a complete clean and known environment. Take a look at this one: https://jenkins.eclipse.org/es/job/2_security-run-tck-against-staged-build/configure

The full script:


#!/usr/bin/env groovy

node {
   
    def API_JAR_NAME = "jakarta.security.enterprise-api.jar"
    def DOWNLOAD_API_JAR_NAME = "jakarta.security.enterprise-api-1.0.2.jar"
    
    
    
    // TCK properties
    env.deliverabledir="security"
    env.TCK_HOME="${env.WORKSPACE}"
    env.TS_HOME="${env.WORKSPACE}/${env.deliverabledir}-tck"
    env.javaee_home="${env.WORKSPACE}/glassfish5"
    
    env.ANT_VERSION='1.9.13'
    env.TOOLS_PREFIX='/opt/tools'
    env.JAVA_PREFIX="${TOOLS_PREFIX}/java/oracle"
    env.MVN_HOME="${TOOLS_PREFIX}/apache-maven/latest"
    env.JAVA_HOME="${JAVA_PREFIX}/jdk-8/latest"
    env.PATH="${MVN_HOME}/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    env.ANT_HOME="${TS_HOME}/tools/ant"
    env.PATH="${ANT_HOME}/bin:${PATH}"
    env.ANT_OPTS="-Djavax.xml.accessExternalSchema=all"
    
    stage("Init") {
         sh '''#!/bin/bash -x
        
            mkdir download
            
           '''
    }
    
    stage("Grab GF") {
    env.GF_URL = "${GF_URL}"
        sh '''#!/bin/bash -ex
        
            cd ${WORKSPACE}/download
            wget -q ${GF_URL} -O glassfish.zip
            
            cd ${WORKSPACE}
            unzip -q ${WORKSPACE}/download/glassfish.zip
            
           '''
    }
    
    stage("Grab API") {
    env.API_URL = "${API_URL}"
    env.API_JAR_NAME = "${API_JAR_NAME}"
        sh '''#!/bin/bash -ex
        
            cd ${WORKSPACE}/download
            wget -q ${API_URL} -O ${API_JAR_NAME}
            
           '''
    }
    
    stage("Grab TCK") {
        env.TCK_BUNDLE_URL = "${TCK_BUNDLE_URL}"
        sh '''#!/bin/bash -ex
            cd ${WORKSPACE}/download 
            wget -q ${TCK_BUNDLE_URL} -O ${deliverabledir}tck.zip
            
            cd ${WORKSPACE}
            unzip ${WORKSPACE}/download/${deliverabledir}tck.zip
           '''
    }
   
    stage ("Grab ANT") {
        sh '''#!/bin/bash -ex
        
            cd ${WORKSPACE}/download
            tar xfz ant.tar.gz
            mkdir -p ${ANT_HOME} && cp -a ${WORKSPACE}/download/apache-ant-${ANT_VERSION}/. ${ANT_HOME}
           
           '''
    }
    
    stage ("Replace API in GF") {
        env.API_JAR_NAME = "${API_JAR_NAME}"
        env.DOWNLOAD_API_JAR_NAME = "${DOWNLOAD_API_JAR_NAME}"
        sh '''#!/bin/bash -ex
            rm $javaee_home/glassfish/modules/${API_JAR_NAME}
            cp -v ${WORKSPACE}/download/${API_JAR_NAME} $javaee_home/glassfish/modules
            
            '''
    }
    
    stage ("Configure ts.jte") {
       
        sh '''#!/bin/bash -ex
           
            cd ${TS_HOME}/bin/
            
            sed -i "s#web.home=.*#web.home=$TCK_HOME/glassfish5/glassfish#g" ts.jte
            sed -i "s#^report.dir=.*#report.dir=$TCK_HOME/securityapitckreport/securityapitck#g" ts.jte
            sed -i "s#^work.dir=.*#work.dir=$TCK_HOME/securityapitckwork/securityapitck#g" ts.jte

            sed -i 's#securityapi.classes=.*#securityapi.classes=${web.home}/modules/jakarta.servlet-api.jar${pathsep}${web.home}/modules/jakarta.security.enterprise-api.jar${pathsep}${web.home}/modules/jakarta.security.auth.message-api.jar${pathsep}${web.home}/modules/endorsed/jakarta.annotation-api.jar${pathsep}${web.home}/modules/jakarta.inject.jar${pathsep}${web.home}/modules/cdi-api.jar${pathsep}${web.home}/modules/jakarta.faces.jar${pathsep}${web.home}/modules/jakarta.interceptor-api.jar${pathsep}${web.home}/modules/jakarta.ejb-api.jar${pathsep}/${ts.home}/lib/unboundid-ldapsdk.jar#g' ts.jte

                       
           '''
    }
  
    stage("Restart GF") {
        sh '''#!/bin/bash -ex
        
             cd $javaee_home/bin
             ./asadmin stop-domain
         
             if [ $retval != 0 ]; then
                echo "Pending process to be killed:"
                ps -eaf | grep "com.sun.enterprise.admin.cli.AdminMain" | grep -v "grep" | grep -v "nohup" 
                for i in `ps -eaf | grep "com.sun.enterprise.admin.cli.AdminMain" | grep -v "grep" | grep -v "nohup" | tr -s " " | cut -d" " -f2`
                do
                    echo "[killJava.sh] kill -9 $i"
                     kill $i
                 done
             fi
           
            ./asadmin start-domain
            
           '''
    }
    
     stage("Configure TCK") {
        sh '''#!/bin/bash -ex
           
            cd ${TS_HOME}/bin
            ant config.vi
            ant init.ldap
            
           '''
    }
   
    stage ("Run TCK tests") {
         sh '''#!/bin/bash -x
         
         cd $TS_HOME/bin
         
         ant deploy.all
         ant run.all | tee -a ${TS_HOME}/bin/run.log
        
           '''       
    } 
    
    stage ("Create summary.txt, API, and run.log artifacts") {
        sh '''#!/bin/bash -ex
            cd ${TS_HOME}/bin
            cat run.log | sed -e '1,/Completed running/d' > summary.txt
            PASSED_COUNT=`head -1 summary.txt | tail -1 | sed 's/.*=\\s\\(.*\\)/\\1/'`
            FAILED_COUNT=`head -2 summary.txt | tail -1 | sed 's/.*=\\s\\(.*\\)/\\1/'`
            ERROR_COUNT=`head -3 summary.txt | tail -1 | sed 's/.*=\\s\\(.*\\)/\\1/'`
            
            SHA256_GF=`openssl dgst -sha256 ${WORKSPACE}/download/glassfish.zip`
            SHA256_API=`openssl dgst -sha256 ${WORKSPACE}/download/${API_JAR_NAME}`
            SHA256_TCK=`openssl dgst -sha256 ${WORKSPACE}/download/${deliverabledir}tck.zip`
            
            echo ERROR_COUNT=${ERROR_COUNT}
            echo FAILED_COUNT=${FAILED_COUNT}
            echo PASSED_COUNT=${PASSED_COUNT}
            
            echo SHA256_GF=${SHA256_GF} | tee -a summary.txt
            echo SHA256_API=${SHA256_API} | tee -a summary.txt
            echo SHA256_TCK=${SHA256_TCK}  | tee -a summary.txt
            
           '''

        archiveArtifacts artifacts: "${env.deliverabledir}-tck/bin/summary.txt", fingerprint: true
        archiveArtifacts artifacts: "${env.deliverabledir}-tck/bin/run.log", fingerprint: true
        archiveArtifacts artifacts: "glassfish5/glassfish/modules/${API_JAR_NAME}", fingerprint: true
    }
}


External parameters are:

SERVER_HOME=${ts.home}/../glassfish5/glassfish
HARNESS_REPORT_DIR=${ts.home}/../JTreport
HARNESS_WORK_DIR=${ts.home}/../JTwork


My friend Patrik also created a very nice runner for Payara which should be quite easy to get running, also giving you some idea of what to do


Kind regards,
Arjan





On Fri, Sep 27, 2019 at 11:40 PM Ryan Cuprak <rcuprak@xxxxxxxxx> wrote:

This wiki page makes it look deceptively simple:
https://github.com/eclipse-ee4j/jakartaee-tck/wiki/Instructions-for-building-and-running-JakartaEE-TCK-bundle

What type of effort is involved? 

What’s a good TCK to start with? 

Thanks,
-Ryan

On Sep 27, 2019, at 5:21 PM, Bill Shannon <bill.shannon@xxxxxxxxxx> wrote:

Running the complete platform TCK is a huge amount of effort.  If you've read all the instructions, including the TCK Users Guide that's included in the TCK download, and you still can't make it work, you'll need to ask a more specific question.

I strongly recommend that you start with one of the simpler individual TCKs that works with a standalone implementation, just to get a general idea of how the TCKs work.  The platform TCK is orders of magnitude more complex than the individual TCKs.


Ryan Cuprak wrote on 9/27/19 2:08 PM:
Hello,
How does one run the Jakarta EE TCK? I tried checking out what I think is the code and following the instructions here:

 Has anyone run the TCK? I would like to run it against a couple of different implementations and get a better sense of how it is implemented etc.

Thanks,
-Ryan

 

_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev


_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev

Back to the top