Tests relying on .bashrc being loaded not working
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- bash, docker
- Área
- testing-qa, tooling
Línea de trabajo
Comienza con la ruta de ejecución de commandTests y el comportamiento del setup entrypoint descrito en el issue, utilizando el Debian Dockerfile y los casos YAML proporcionados como reproductor. Compara el manejo del entorno para comandos directos, bash -c, .bashrc obtenido mediante source y setup entrypoints; se considera terminado cuando las pruebas relevantes observan FOO=BAR de forma consistente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi all.
First of all... great library, really like the simplicity of it.
We have a fairly rich docker container that makes heavy use of bash scripting to dynamically define env variables in the ~/,bashrc. After trying all kind of things for the last days I cannot get container structure tests to work in the context of the bashrc. Whatever I do, the env vars seem to be undefined.
Here's an example Dockerfile I wrote up:
FROM debian:buster
RUN echo "export FOO=BAR" >> /root/.bashrc
RUN echo "echo 'bashrc loaded!'" >> ~/.bashrc
# this is strictly seen not necessary, but it forces the bashrc to be always loaded, not just in interactive mode and suppresses a related warning:
ENV BASH_ENV=/root/.bashrc
These are my example tests - they all fail.
The output indicates that the .bashrc is actually loaded, but the actual test seems to run separately under a different context - FOO seems never defined in the test context and the output of $FOO is always blank.
schemaVersion: 2.0.0
commandTests:
- name: "echo FOO"
command: echo
args: [ "$FOO" ]
expectedOutput: [ "BAR" ]
- name: "echo FOO using bash -c wrapper and enumerated args"
command: "bash"
args:
- -c
- "echo $FOO"
expectedOutput: [ "BAR" ]
- name: "echo FOO using bash -c wrapper and string array args"
command: "bash"
args: ["-c", "echo $FOO"]
expectedOutput: [ "BAR" ]
- name: "echo FOO using bash -c wrapper, pipe and source .bashrc"
command: "bash"
args:
- -c
- |
source ~/.bashrc &&
echo $FOO
expectedOutput: [ "BAR" ]
I also tried to specify a custom entry point using setup: [["entrypoint.sh"]] with the same result.
entrypoint.sh:
#!/bin/bash
source /root/.bashrc
Any help is greatly appreciated!
We already wrote fair a bit of non-bash tests, but cannot use this framework without proper bash support :(
- Lenguaje dominante
- Go
- Estrellas
- 2.5k
- Forks
- 213
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de GoogleContainerTools/container-structure-test
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
allstar
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
GoogleContainerTools/container-structure-test#393 · 639 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
GoogleContainerTools/container-structure-test#280 · 1 reacción ·
-
go.mod pins vulnerable docker/containerd modules; two open Dependabot PRs clear most findingsAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
Windows: structure_test binary missing .exe extension causes "Open With" dialog instead of running testsPosiblemente ocupada @peakschris la tomó hace 143 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
Todos los issues de GoogleContainerTools/container-structure-test
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
yetone/magpie#4095 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
docs: Google Safe Browsing flags go-bonnie.dev as "deceptive" (pipe-to-shell install instructions)Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
[Bug]: Telegram bot (v3.11.0): "Ban log" no longer sends the current 3xipl-banned.logPosiblemente ocupada @HamedSanaei la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
MHSanaei/3x-ui#6990 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
bug(tool/internal/instrument): identical inject_code rules from two rule packages are applied twiceAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
open-telemetry/opentelemetry-go-compile-instrumentation#1611 ·
Los mantenedores suelen responder en 2 días