forked from containerbuildsystem/cachi2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integration tests: Use single test repository
Modify each test module to use a branch (not a git commit) as a reference inside the new integration test repository that contains all integration (e2e) tests for cachi2. Update and improve a few functions inside utils.py Drop unnecessary lines from each Containerfile that were blindly duplicated along with the comments. Plus, they were tightly coupled with our code printing output of specific files inside of directories coming from pytest. closes containerbuildsystem#676 Signed-off-by: Michal Šoltis <msoltis@redhat.com>
- Loading branch information
1 parent
bbd0262
commit f281d5d
Showing
31 changed files
with
283 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 1 addition & 15 deletions
16
tests/integration/test_data/bundler_everything_present/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
FROM docker.io/ruby:3.3 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check bundler deps | ||
RUN ls /tmp/bundler_everything_present-output/deps/bundler | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/bundler_everything_present-source/ | ||
|
||
# This should be a COPY, but the source code and Containerfile are in different directories | ||
RUN cp -r /tmp/bundler_everything_present-source /src | ||
|
||
WORKDIR /src | ||
|
||
RUN . /tmp/cachi2.env && bundle install |
16 changes: 1 addition & 15 deletions
16
...s/integration/test_data/bundler_everything_present_except_gemspec/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
FROM docker.io/ruby:3.3 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check bundler deps | ||
RUN ls /tmp/bundler_everything_present_except_gemspec-output/deps/bundler | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/bundler_everything_present_except_gemspec-source/ | ||
|
||
# This should be a COPY, but the source code and Containerfile are in different directories | ||
RUN cp -r /tmp/bundler_everything_present_except_gemspec-source /src | ||
|
||
WORKDIR /src | ||
|
||
RUN . /tmp/cachi2.env && bundle install |
4 changes: 2 additions & 2 deletions
4
tests/integration/test_data/generic_e2e/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM registry.fedoraproject.org/fedora:40 | ||
|
||
RUN cp -r /tmp/generic_e2e-output/deps/generic/ /deps | ||
RUN cp -r /tmp/cachi2-output/deps/generic/ /deps | ||
|
||
CMD ["ls", "-al", "/deps"] | ||
CMD ["ls", "-al", "/deps"] |
2 changes: 1 addition & 1 deletion
2
tests/integration/test_data/generic_maven_e2e/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM docker.io/ibmjava:11-jdk | ||
|
||
RUN cp -r /tmp/generic_maven_e2e-output/deps/generic/ /deps | ||
RUN cp -r /tmp/cachi2-output/deps/generic/ /deps | ||
|
||
CMD ["java", "-cp", "/deps/ant.jar:/deps/ant-launcher.jar", "org.apache.tools.ant.Main", "-version"] |
13 changes: 2 additions & 11 deletions
13
tests/integration/test_data/gomod_1.18_e2e_test/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
FROM docker.io/golang:1.18.1 AS build | ||
FROM docker.io/golang:1.18.1 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/gomod_1.18_e2e_test-source/ | ||
|
||
WORKDIR /tmp/gomod_1.18_e2e_test-source | ||
WORKDIR /src | ||
RUN . /tmp/cachi2.env && go build -o /usr/bin/retrodep | ||
|
||
CMD retrodep --help |
16 changes: 2 additions & 14 deletions
16
tests/integration/test_data/gomod_1.20_e2e_dirty_go.mod/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 2 additions & 11 deletions
13
tests/integration/test_data/gomod_1.21_e2e_test/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
FROM docker.io/golang:1.21.5 AS build | ||
FROM docker.io/golang:1.21.5 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/gomod_1.21_e2e_test-source/ | ||
|
||
WORKDIR /tmp/gomod_1.21_e2e_test-source | ||
WORKDIR /src | ||
RUN . /tmp/cachi2.env && go build -o /usr/bin/retrodep | ||
|
||
CMD retrodep --help |
13 changes: 2 additions & 11 deletions
13
tests/integration/test_data/gomod_1.22_e2e_workspace_vendoring/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
FROM docker.io/golang:1.22.0 AS build | ||
FROM docker.io/golang:1.22.0 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/gomod_1.22_e2e_workspace_vendoring-source | ||
|
||
WORKDIR /tmp/gomod_1.22_e2e_workspace_vendoring-source/hi/hiii | ||
WORKDIR /src/hi/hiii | ||
RUN . /tmp/cachi2.env && go build -o /usr/bin/hiii | ||
|
||
CMD hiii |
8 changes: 1 addition & 7 deletions
8
tests/integration/test_data/gomod_e2e_multiple_modules/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 2 additions & 17 deletions
19
tests/integration/test_data/npm_lockfile3_aliased_deps/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,5 @@ | ||
FROM docker.io/node:18 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
WORKDIR /src | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check npm deps | ||
RUN ls /tmp/npm_lockfile3_aliased_deps-output/deps/npm | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/npm_lockfile3_aliased_deps-source/ | ||
|
||
WORKDIR /tmp/npm_lockfile3_aliased_deps-source | ||
|
||
# Install packages and list them | ||
RUN . /tmp/cachi2.env && \ | ||
npm install && \ | ||
npm ll --parseable > /opt/npm-ls-output.txt | ||
RUN . /tmp/cachi2.env && npm install |
19 changes: 2 additions & 17 deletions
19
tests/integration/test_data/npm_lockfile3_dev_optional_peer_deps/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,5 @@ | ||
FROM docker.io/node:18 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
WORKDIR /src | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check npm deps | ||
RUN ls /tmp/npm_lockfile3_dev_optional_peer_deps-output/deps/npm | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/npm_lockfile3_dev_optional_peer_deps-source/ | ||
|
||
WORKDIR /tmp/npm_lockfile3_dev_optional_peer_deps-source | ||
|
||
# Install packages and list them | ||
RUN . /tmp/cachi2.env && \ | ||
npm install && \ | ||
npm ls -a --parseable > /opt/npm-ls-output.txt | ||
RUN . /tmp/cachi2.env && npm install |
19 changes: 2 additions & 17 deletions
19
tests/integration/test_data/npm_lockfile3_multiple_dep_versions/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,5 @@ | ||
FROM docker.io/node:18 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
WORKDIR /src | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check npm deps | ||
RUN ls /tmp/npm_lockfile3_multiple_dep_versions-output/deps/npm | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/npm_lockfile3_multiple_dep_versions-source/ | ||
|
||
WORKDIR /tmp/npm_lockfile3_multiple_dep_versions-source | ||
|
||
# Install packages and list them | ||
RUN . /tmp/cachi2.env && \ | ||
npm install && \ | ||
npm ll --parseable > /opt/npm-ls-output.txt | ||
RUN . /tmp/cachi2.env && npm install |
20 changes: 4 additions & 16 deletions
20
tests/integration/test_data/npm_multiple_packages_lockfile3/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
FROM docker.io/node:17 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
WORKDIR /src/first_pkg | ||
RUN . /tmp/cachi2.env && npm install && npm ls | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check npm deps | ||
RUN ls /tmp/npm_multiple_packages_lockfile3-output/deps/npm | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/npm_multiple_packages_lockfile3-source/ | ||
|
||
WORKDIR /tmp/npm_multiple_packages_lockfile3-source | ||
|
||
# Install packages | ||
RUN cd ./first_pkg && . /tmp/cachi2.env && npm i && npm ls | ||
RUN cd ./second_pkg && . /tmp/cachi2.env && npm i && npm ls | ||
WORKDIR /src/second_pkg | ||
RUN . /tmp/cachi2.env && npm install && npm ls |
17 changes: 2 additions & 15 deletions
17
tests/integration/test_data/npm_smoketest_lockfile2/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,5 @@ | ||
FROM docker.io/node:17 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
WORKDIR /src | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check pip deps | ||
RUN ls /tmp/npm_smoketest_lockfile2-output/deps/npm | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/npm_smoketest_lockfile2-source/ | ||
|
||
WORKDIR /tmp/npm_smoketest_lockfile2-source | ||
|
||
# Install packages | ||
RUN . /tmp/cachi2.env && npm i && npm ls | ||
RUN . /tmp/cachi2.env && npm install && npm ls |
17 changes: 2 additions & 15 deletions
17
tests/integration/test_data/npm_smoketest_lockfile3/container/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,5 @@ | ||
FROM docker.io/node:18 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
WORKDIR /src | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check pip deps | ||
RUN ls /tmp/npm_smoketest_lockfile3-output/deps/npm | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/npm_smoketest_lockfile3-source/ | ||
|
||
WORKDIR /tmp/npm_smoketest_lockfile3-source | ||
|
||
# Install packages | ||
RUN . /tmp/cachi2.env && npm i && npm ls | ||
RUN . /tmp/cachi2.env && npm install && npm ls |
Oops, something went wrong.