Skip to content

Commit

Permalink
Update e2e tests to use Dex and perform login operation that is then …
Browse files Browse the repository at this point in the history
…tested
  • Loading branch information
treydock committed Dec 24, 2020
1 parent 75062f0 commit 8107471
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 405 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,12 @@ jobs:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v2

- name: Setup Ruby using Bundler
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.5.5"
bundler-cache: true
bundler: "1.17.3"

- name: Run E2E tests
run: rake test:e2e
run: bundle exec rake test:e2e
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,6 @@ tags
/packaging/*.pp
/packaging/*.if
/packaging/tmp

# Ignore files downloaded for testing
/tests/*.zip
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "rake"

group :test do
gem "rspec"
gem "watir"
end
38 changes: 38 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
GEM
remote: https://rubygems.org/
specs:
childprocess (3.0.0)
diff-lcs (1.4.4)
rake (13.0.3)
regexp_parser (1.8.2)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.0)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.0)
rubyzip (2.3.0)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
watir (6.17.0)
regexp_parser (~> 1.2)
selenium-webdriver (~> 3.6)

PLATFORMS
ruby

DEPENDENCIES
rake
rspec
watir

BUNDLED WITH
1.17.3
2 changes: 1 addition & 1 deletion docker/launch-ood
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -e

runuser -u ondemand-dex /usr/sbin/ondemand-dex serve /etc/ood/dex/config.yaml &
/opt/rh/httpd24/root/usr/sbin/httpd-scl-wrapper -DFOREGROUND
/usr/sbin/httpd -DFOREGROUND
12 changes: 10 additions & 2 deletions lib/tasks/container_files/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN dnf -y update && \
ondemand-ruby \
ondemand-nodejs \
ondemand-python \
ondemand-dex \
ondemand-passenger \
ondemand-nginx && \
dnf clean all && rm -rf /var/cache/dnf/*
Expand All @@ -32,6 +33,7 @@ RUN mkdir -p /opt/ood
RUN mkdir -p /var/www/ood/{apps,public,discover}
RUN mkdir -p /var/www/ood/apps/{sys,dev,usr}

COPY docker/launch-ood /opt/ood/launch
COPY mod_ood_proxy /opt/ood/mod_ood_proxy
COPY nginx_stage /opt/ood/nginx_stage
COPY ood-portal-generator /opt/ood/ood-portal-generator
Expand All @@ -49,6 +51,11 @@ RUN source /opt/rh/ondemand/enable && \
RUN mkdir -p /etc/ood/config
RUN cp /opt/ood/nginx_stage/share/nginx_stage_example.yml /etc/ood/config/nginx_stage.yml
RUN cp /opt/ood/ood-portal-generator/share/ood_portal_example.yml /etc/ood/config/ood_portal.yml
RUN sed -i -r \
-e 's/^#listen_addr_port:.*/listen_addr_port: 8080/g' \
-e 's/^#port:.*/port: 8080/g' \
-e 's/^#servername:.*/servername: localhost/g' \
/etc/ood/config/ood_portal.yml

# make some misc directories & files
RUN mkdir -p /var/lib/ondemand-nginx/config/apps/{sys,dev,usr}
Expand All @@ -66,5 +73,6 @@ RUN echo $VERSION > /opt/ood/VERSION
# this one bc centos:8 doesn't generate localhost cert
RUN /usr/libexec/httpd-ssl-gencerts

EXPOSE 80
CMD [ "/usr/sbin/httpd", "-DFOREGROUND" ]
EXPOSE 8080
EXPOSE 5556
CMD [ "/opt/ood/launch" ]
9 changes: 2 additions & 7 deletions lib/tasks/container_files/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ ARG USER=ood
ARG UID=1000
ARG GID=1000

RUN dnf reinstall -y httpd-tools

RUN groupadd -g $GID $USER && \
useradd -u $UID --create-home --gid $USER $USER && \
/usr/bin/htpasswd -b -c /etc/httpd/.htpasswd $USER $USER

COPY lib/tasks/container_files/test/entrypoint.sh /entrypoint.sh
useradd -u $UID --create-home --gid $USER $USER

CMD [ "/entrypoint.sh" ]
CMD [ "/opt/ood/launch" ]

6 changes: 0 additions & 6 deletions lib/tasks/container_files/test/entrypoint.sh

This file was deleted.

Loading

0 comments on commit 8107471

Please sign in to comment.