Giter VIP home page Giter VIP logo

Comments (6)

chrisgahlert avatar chrisgahlert commented on June 30, 2024 2

Fixed in new version 0.9.1 available now.

from gradle-dcompose-plugin.

chrisgahlert avatar chrisgahlert commented on June 30, 2024

Quick workaround:

Include this in your build.gradle:

allprojects { prj ->
    prj.tasks.withType(com.chrisgahlert.gradledcomposeplugin.tasks.AbstractDcomposeTask) { task ->
        task.dockerClassLoaderFactory.getDefaultInstance()
    }
}

I'll be releasing a new version soon... and thanks for reporting! ;)

from gradle-dcompose-plugin.

phauer avatar phauer commented on June 30, 2024

Thank you for fixing this so fast!

from gradle-dcompose-plugin.

blankdots avatar blankdots commented on June 30, 2024

@chrisgahlert Thank you!

Just a question regarding DcomposeCopyFileFromContainerTask as I noticed that with the new version i am having trouble copying the files (works in Gradle 3.5 with the new version of the plugin, files are copied). So does this look like a bug or I am doing something wrong (e.g. use Sync ?) or missing something (some changes in Gradle 4.0) ?

Error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':tests:copyReportFiles'.
> Docker command failed: Could not find the file /tmp/build/reports/tests in container dcompose_4164440d_test

The source:

task copyReportFiles(type: DcomposeCopyFileFromContainerTask) {
    service = dcompose.test
    containerPath = '/tmp/build/reports/tests'
    destinationDir = file("build/reports/")
    cleanDestinationDir = false
}

startTestContainer.finalizedBy copyReportFiles

If necessary I can provide the full Gradle file.

from gradle-dcompose-plugin.

chrisgahlert avatar chrisgahlert commented on June 30, 2024

I don't think this is related to the plugin itself:

The DcomposeCopyFileFromContainerTask can copy files from containers - whether they are running or not (i.e. they might have never been started). The task only has a dependency on the create<Service>Container task.

For this reason I'm suspecting that you always copied the files from a container, where the startTestContainer task was previously executed causing the missing files to exist.

So in your example you would need to do the following:

  1. Add a dependency to the start task:
task copyReportFiles(type: DcomposeCopyFileFromContainerTask) {
    service = dcompose.test
    ...
    dependsOn startTestContainer // or more generic: "$service.projectPath:$service.startContainerTaskName"
}
  1. In order to wait for the container to finish it's task, I would recommend to add the following properties:
dcompose {
  test {
    // image,baseDir,command = ...
   
    waitForCommand = true // makes sure that the process will finish before moving to the copy task
    attachStdout = true // helpful for debugging: will be piped to System.out by default
    attachStderr = true // helpful for debugging: will be piped to System.err by default
  }
}

from gradle-dcompose-plugin.

blankdots avatar blankdots commented on June 30, 2024

@chrisgahlert Thank you!!
Point 2 was already satisfied, also included point 1.

I was able to pinpoint the issue to how those tests reports were generated (or more precisely were not generated); I was not really happy with that env in the first place, so this gave me a good reason to change it.

from gradle-dcompose-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.