Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[egit-dev] Re: [master] Change I5828502f: (egit/parallelip-jgit) Change jgit build to be completely manifest first

Shawn,

I have hacked test pom.xml to use plain junit launcher while still
resolving dependencies from p2 repositories. Tests from exttst source
folder are failing for me both in IDE and on CLI, so I excluded them
from execution. Not sure if this was expected, though.

I still have not figured out how to use gerrit properly (somehow I got
merge extra commit), so I've attached the pom.xml file instead.

--
Regards,
Igor



Shawn O. Pearce wrote:
Igor Fedorenko <ifedorenko@xxxxxxxxxxxx> wrote:
Shawn O. Pearce wrote:
Igor Fedorenko <ifedorenko@xxxxxxxxxxxx> wrote:
I was going to finish font&colour decoration tonight, but I'll try to
make the tests work in cli instead. Assuming my wife won't find other
things for me to do, that is ;-)
Thanks.
I had a very quick look. You have the same package, say
org.eclipse.jgit.treewalk, defined both in org.eclipse.jgit and
org.eclipse.jgit.test bundles. You also use Import-Package to wire
org.eclipse.jgit and org.eclipse.jgit.test together. Normally, there is
only one producer of each package, so Import-Package gets resolved to
org.eclipse.jgit, which effectively hides test classes at runtime.

Wow.  Thanks for figuring that out, I am apparently a complete moron.

I think we do want our tests declared in the same package as the
code they test, sometimes we use package visibility to help test
internals, but we never want to expose that internal to a public
API consumer because we might break the interface in the future.

I see few possible solutions here.

If running the tests in OSGi runtime is not required, I can switch them
back to plain junit launcher. This may require switching test project
back to pom-first mode, but I don't know for sure yet.

The only reason to run the JGit tests in an OSGi runtime was to
take advantage of the manifest-first dependency format.  We could
switch the tests back to pom-first mode.

Also, keep in mind that bundle classloader.getResource and similar
methods return bundleentry:// urls, but there are at least few places in
the tests where you do "new File(cl.getResource(...).toURI())". This
will have to change to run in OSGi runtime.

Yea, apparently we don't want to run our tests under an OSGi runtime.
At least not right now.

One of our developers asked webtide folks ;-). The irony, I spent almost
two days extending tycho to be able to mix p2 and maven repositories.
When I was done and said the final "woo-hoo!" that developer gave me
jetty p2 repo url.

:-)

<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright (C) 2009, Google Inc.

   All rights reserved.

   Redistribution and use in source and binary forms, with or
   without modification, are permitted provided that the following
   conditions are met:

   - Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

   - Redistributions in binary form must reproduce the above
     copyright notice, this list of conditions and the following
     disclaimer in the documentation and/or other materials provided
     with the distribution.

   - Neither the name of the Eclipse Foundation, Inc. nor the
     names of its contributors may be used to endorse or promote
     products derived from this software without specific prior
     written permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
   CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.eclipse.jgit</groupId>
    <artifactId>jgit-parent</artifactId>
    <version>0.6.0-SNAPSHOT</version>
  </parent>

  <packaging>eclipse-plugin</packaging>
  <artifactId>org.eclipse.jgit.test</artifactId>
  <name>JGit - Core Tests</name>

  <description>
    JUnit tests for the core library.
  </description>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.5</version>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>tst-rsrc</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.4.2</version>
        <executions>
          <execution>
            <id>default</id>
            <goals>
              <goal>test</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <testClassesDirectory>${project.build.outputDirectory}</testClassesDirectory>
              <includes>
                <include>**/*Test.java</include>
                <include>**/*TestCase.java</include>
                <include>**/T000*.java</include>
              </includes>
              <excludes>
                <exclude>org/eclipse/jgit/lib/SpeedTestBase*.java</exclude>
                <exclude>org/eclipse/jgit/lib/T0005_ShallowSpeedTest*.java</exclude>
                <exclude>org/eclipse/jgit/lib/T0006_DeepSpeedTest*.java</exclude>
                <exclude>org/eclipse/jgit/lib/T0007_GitIndexTest*.java</exclude>
                <exclude>org/eclipse/jgit/patch/EGitPatchHistoryTest*.java</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Back to the top