Skip to content

Add Dockerfile for running test - #1736

Merged
PeterSurda merged 1 commit into
Bitmessage:v0.6from
PeterSurda:dockertest
Feb 17, 2021
Merged

Add Dockerfile for running test#1736
PeterSurda merged 1 commit into
Bitmessage:v0.6from
PeterSurda:dockertest

Conversation

@PeterSurda

@PeterSurda PeterSurda commented Feb 15, 2021

Copy link
Copy Markdown
Member
  • run ./run-tests-in-docker.sh to run travis tests locally

@PeterSurda PeterSurda added developers The issue is relevant mainly for developers rather than users test labels Feb 15, 2021
@PeterSurda PeterSurda added this to the v0.6.4 milestone Feb 15, 2021
@PeterSurda
PeterSurda requested a review from g1itch February 15, 2021 08:22
@g1itch

g1itch commented Feb 15, 2021

Copy link
Copy Markdown
Collaborator

I'm checking the ./run-tests-in-docker.sh. I hope it downloads less than 6 Gb (: Did you try to do RUN apt-get update once, e.g.:

FROM ubuntu:bionic AS pybm-travis-bionic
ENV DEBIAN_FRONTEND noninteractive
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update

@g1itch

g1itch commented Feb 15, 2021

Copy link
Copy Markdown
Collaborator

Also I'm not sure about python-pycryptopp, where it's used.

@PeterSurda

Copy link
Copy Markdown
Member Author

I'll test the changes you asked about.

@g1itch

g1itch commented Feb 15, 2021

Copy link
Copy Markdown
Collaborator

apt-get seems to install an old python-psutil: https://buildbot.bitmessage.org/#/builders/22/builds/6/steps/7/logs/stdio

@g1itch

g1itch commented Feb 15, 2021

Copy link
Copy Markdown
Collaborator

Maybe use useradd, not adduser? It produces this:

Copying files from `/etc/skel' ...
Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error
passwd: password unchanged
Use of uninitialized value $answer in chop at /usr/sbin/adduser line 591.
Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 592.
Try again? [y/N] Changing the user information for builder
Enter the new value, or press ENTER for the default
	Full Name []: 	Room Number []: 	Work Phone []: 	Home Phone []: Other []: Use of uninitialized value $answer in chop at /usr/sbin/adduser line 621.
Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 622.
Is the information correct? [Y/n]

Comment thread Dockerfile.travis
RUN chmod +x /usr/local/bin/travis2bash.sh

COPY . /home/builder/src
RUN chown -R builder.builder /home/builder/src

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Strange. man chown says chown [OPTION]... [OWNER][:[GROUP]] FILE...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think OWNER.GROUP is a GNU non-POSIX feature, maybe it doesn't work on BSD, I've been using it on linux since the '90s. But I can change it, no big deal.

@g1itch

g1itch commented Feb 15, 2021

Copy link
Copy Markdown
Collaborator

@g1itch g1itch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It works!

@PeterSurda

Copy link
Copy Markdown
Member Author

I can add some conditional for skipping redundancies, I can't just remove them because in some jobs / situations they are needed, the same travis2bash.sh script is used in VMs, in docker, inside and outside of buildbot, and the environments differ.

@PeterSurda
PeterSurda force-pushed the dockertest branch 2 times, most recently from e5ac39d to 87ee439 Compare February 16, 2021 09:13
@PeterSurda

PeterSurda commented Feb 16, 2021

Copy link
Copy Markdown
Member Author
  • only one apt update in total now
  • use POSIX arguments for chown
  • only call apt install once twice inside Dockerfile.travis
  • use useradd instead of adduser
  • remove python-pycryptopp

- run ./run-tests-in-docker.sh to run travis tests locally
@PeterSurda
PeterSurda merged commit 574b60e into Bitmessage:v0.6 Feb 17, 2021
@PeterSurda
PeterSurda deleted the dockertest branch February 17, 2021 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

developers The issue is relevant mainly for developers rather than users test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants