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

chore(e2e): rhidp-6351 Update Dockerfile, workflows, and scripts for Yarn support #2543

Merged
merged 2 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ plugins
coverage
dist-types
examples
.ibm/images/*
!.ibm/images/Dockerfile
!.yarnrc.yml
8 changes: 6 additions & 2 deletions .github/workflows/push-e2e-runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- '.ibm/images/Dockerfile'
- '.yarnrc.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -51,7 +52,10 @@ jobs:
- name: Build and Push Image
uses: docker/build-push-action@v5
with:
context: .ibm/images/
context: .
file: .ibm/images/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}
tags: |
${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}
${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}-${{ env.SHORT_SHA }}
platforms: ${{ env.PLATFORM }}
12 changes: 9 additions & 3 deletions .ibm/images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ ENV CI=1 \
GOPATH="/go" \
PATH="$GOPATH/bin:/usr/local/go/bin:$PATH"

# Copy the .yarnrc.yml file to the environment
COPY .yarnrc.yml /root/.yarnrc.yml

# Extract the correct version from the file and install
RUN YARN_VERSION=$(awk '/yarnPath:/ {print $2}' /root/.yarnrc.yml | awk -F'[-.]' '{print $(NF-1)"."$NF}') && rm -f /root/.yarnrc.yml

# Install essential dependencies and Node.js tools
RUN apt-get update && apt-get install -y --no-install-recommends \
make gcc g++ python3 rsync sshpass \
Expand All @@ -24,7 +30,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
apache2-utils \
gettext \
curl wget jq colorized-logs && \
npm install -g typescript yarn@latest && \
npm install -g typescript yarn@$YARN_VERSION && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
echo "Node: $(node -v)\nNPM: $(npm -v)\nYarn: $(yarn -v)\nTypeScript: $(tsc -v)"

Expand Down Expand Up @@ -64,12 +70,12 @@ RUN apt-get update -y && \
apt-get install -y skopeo

# Install umoci
RUN curl -LO "https://github.com/opencontainers/umoci/releases/download/v0.4.7/umoci.amd64" && \
RUN curl -LO "https://github.com/opencontainers/umoci/releases/download/v0.4.7/umoci.amd64" && \
chmod +x umoci.amd64 && \
mv umoci.amd64 /usr/local/bin/umoci

# Install opm
RUN curl -LO "https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/linux-amd64-opm" && \
RUN curl -LO "https://github.com/operator-framework/operator-registry/releases/download/v1.47.0/linux-amd64-opm" && \
chmod +x linux-amd64-opm && \
mv linux-amd64-opm /usr/local/bin/opm

Expand Down
9 changes: 9 additions & 0 deletions .ibm/images/README
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ For branches **other than `main`**, OpenShift CI does **not** fetch from Quay:
- **GitHub Actions automates the push process** only for `main` branch updates.
- **OpenShift CI mirror has a delay** in updating the image after it is pushed to Quay.
- **Other branches build the image directly**, so changes take effect immediately.

# ----------------------------------------------------------------------------
# IMPORTANT: The build context must be set to the root of the project!
# This is required to ensure the .yarnrc.yml file is included in the build.
#
# To build this image, run the following command from the project root:
#
# podman build -t quay.io/rhdh-community/rhdh-e2e-runner:release-1.y -f .ibm/images/Dockerfile .
# ----------------------------------------------------------------------------
13 changes: 11 additions & 2 deletions .ibm/pipelines/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -628,12 +628,21 @@ create_app_config_map_k8s() {
run_tests() {
local release_name=$1
local project=$2
project=${project}
cd "${DIR}/../../e2e-tests"
local e2e_tests_dir
e2e_tests_dir=$(pwd)

yarn install
yarn install --immutable > /tmp/yarn.install.log.txt 2>&1

INSTALL_STATUS=$?
if [ $INSTALL_STATUS -ne 0 ]; then
echo "=== YARN INSTALL FAILED ==="
cat /tmp/yarn.install.log.txt
exit $INSTALL_STATUS
else
echo "Yarn install completed successfully."
fi

yarn playwright install chromium

Xvfb :99 &
Expand Down
Loading