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

Change BATS image #259

Merged
merged 21 commits into from
Nov 2, 2023
Merged

Change BATS image #259

merged 21 commits into from
Nov 2, 2023

Conversation

Ein-nor
Copy link
Contributor

@Ein-nor Ein-nor commented Oct 29, 2023

The BATS image from Damien Duportal is no longer available in docker hub.
I have forked his repository and pushed the image to my private repository zoeleah/bats.
This is a quick fix, I think the best would be to host the image in the StackStorm Docker Hub Repository or to refactor the tests to use bats/bats.

@Ein-nor Ein-nor marked this pull request as draft October 29, 2023 16:39
@Ein-nor Ein-nor marked this pull request as ready for review October 29, 2023 17:36
@Ein-nor
Copy link
Contributor Author

Ein-nor commented Oct 29, 2023

Updated the URL's for ST2_STREAM_URL and ST2_AUTH_URL

Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!
And good find it's bats that's failing 👍

Looking at the history, we had a similar PR in the K8s repo:
StackStorm/stackstorm-k8s#338
Let's rely on the official bats image so we'll be consistent with the testing approach across the projects.

Oh, and please update the https://github.com/StackStorm/st2-docker/blob/master/CHANGELOG.md as well mentioning your fixes.

tests/st2tests.yaml Outdated Show resolved Hide resolved
@Ein-nor
Copy link
Contributor Author

Ein-nor commented Nov 1, 2023

@armab
I built it a little differently, this reduced the code.
I looked at how it was set up in k8s and tried to recreate it.
But I could not get it to run. I don't think BATS is used/running in k8s.

- name: bats-core image: bats/bats:1.8.2 command: - bash - -ec - | cp -R /opt/bats /tools/
If I run this on my docker-host, I'll get this error:
root@st2-docker-test:/opt/st2-docker# docker run -v tests_tools:/tools -it --entrypoint "/bin/bash" bats/bats:1.8.2 docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown. ERRO[0000] error waiting for container:

You have to start the container with the entrypoint /bin/ash, then it works.
root@st2-docker-test:/opt/st2-docker# docker run -v tests_tools:/tools -it --entrypoint "/bin/ash" bats/bats:1.8.2 /code # exit root@st2-docker-test:/opt/st2-docker# vi tests/st2tests.yaml

A st2test Docker container should be built so that you don't have to install bats and the helper tools at each runtime.

@Ein-nor Ein-nor requested a review from arm4b November 1, 2023 19:20
Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! Installing bats via apt looks good to me.

Noticed one minor typo to fix before merging, otherwise looks good.

tests/st2tests.yaml Outdated Show resolved Hide resolved
remove dash

Co-authored-by: Eugen C. <[email protected]>
@arm4b arm4b merged commit 4407c26 into StackStorm:master Nov 2, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants