Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devcontainer added #163

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

stan-dot
Copy link

@stan-dot stan-dot commented Oct 8, 2024

No description provided.

.devcontainer/devcontainer.json Outdated Show resolved Hide resolved
# Install any development tools you need, for example, Maven, Git, etc.
RUN apt-get update && \
apt-get install -y maven git && \
apt-get clean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will want docker as well for running the testcontainers based integration tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I haven't worked with testcontainers before. I think the docker-in-docker would use the host docker through a socket.

Or rather 'podman in podman' for the DLS users.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really want to approve without knowing the following command passes in a devcontainer:

mvn clean install test-compile failsafe:integration-test failsafe:verify --batch-mode --fail-at-end -Djacoco.skip=true -DskipITs=false -DskipITCoverage=true

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will test this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in which instance would you like to run this?

I could drop it here instead of line 23 in Dockerfile

RUN mvn clean install

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running this now inside my container.

I am not sure what to expect.

I gest a lot of ConnectionRefused errors.

it expects to connect with Phoebus? not sure

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ERROR] Tests run: 186, Failures: 6, Errors: 124, Skipped: 0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It expects to connect to a locally running container. You might need to set some env variables for this to work from https://java.testcontainers.org/supported_docker_environment/

Essentially, there are a bunch of totally end to end tests in that they spin up a container with channel finder, another with postgres, then send http requests to the container to test it. They use the test containers framework for this purpose.

So to me, if we use a devcontainer it makes sense to have the ability to debug these tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course, I've come to suspect it must be the end to end testcontainers stuff, trying to set this up

Thanks for the pointer :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that adding testcontainers support is more than this ticket was for originally and it's a vastly new territory as we don't use testcontainers at Diamond while I am quite familiar with the devcontainer setup.

Theoretically one could have one window open in devcontainer and the other one locally, and run the integration tests there. That would be a quick temporary solution. I tried setting this up and go this error:

The above error is from running locally, after module load maven on a DLS device.

INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.306 s
[INFO] Finished at: 2024-10-30T11:12:28Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.github.git-commit-id:git-commit-id-maven-plugin:9.0.1:revision (get-the-git-infos) on project ChannelFinder: Execution get-the-git-infos of goal io.github.git-commit-id:git-commit-id-maven-plugin:9.0.1:revision failed: Unable to load the mojo 'revision' in the plugin 'io.github.git-commit-id:git-commit-id-maven-plugin:9.0.1' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: pl/project13/maven/git/GitCommitIdMojo has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>io.github.git-commit-id:git-commit-id-maven-plugin:9.0.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/xma12127/.m2/repository/io/github/git-commit-id/git-commit-id-maven-plugin/9.0.1/git-commit-id-maven-plugin-9.0.1.ja

.devcontainer/devcontainer.json Show resolved Hide resolved
Copy link

sonarcloud bot commented Oct 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants