Skip to content

Commit 3249e3b

Browse files
authored
Merge pull request #5372 from DefectDojo/release/2.4.0
Release: Merge release into master from: release/2.4.0
2 parents 22201f3 + 2922d2f commit 3249e3b

File tree

209 files changed

+105133
-43050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+105133
-43050
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.git
22
.gitignore
33
*.md
4-
.env*

.github/labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ integration_tests:
1515

1616
settings_changes:
1717
- any: ['dojo/settings/settings.dist.py']
18+
19+
apiv2:
20+
- any: ['dojo/api_v2/**/*']

.github/workflows/integration-tests.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,33 @@ jobs:
8282
name: integration tests
8383
needs: build
8484
runs-on: ubuntu-latest
85+
strategy:
86+
matrix:
87+
test-case: [
88+
"tests/finding_test.py",
89+
"tests/report_builder_test.py",
90+
"tests/notes_test.py",
91+
"tests/regulations_test.py",
92+
"tests/product_type_test.py",
93+
"tests/product_test.py",
94+
"tests/endpoint_test.py",
95+
"tests/engagement_test.py",
96+
"tests/environment_test.py",
97+
"tests/test_test.py",
98+
"tests/user_test.py",
99+
"tests/group_test.py",
100+
"tests/product_group_test.py",
101+
"tests/product_type_group_test.py",
102+
"tests/product_member_test.py",
103+
"tests/product_type_member_test.py",
104+
"tests/ibm_appscan_test.py",
105+
"tests/search_test.py",
106+
"tests/file_test.py",
107+
"tests/dedupe_test.py",
108+
"tests/check_various_pages.py",
109+
]
110+
fail-fast: false
111+
85112
steps:
86113

87114
- name: Checkout
@@ -112,6 +139,8 @@ jobs:
112139

113140
- name: Integration tests
114141
run: docker-compose up --exit-code-from integration-tests integration-tests
142+
env:
143+
DD_INTEGRATION_TEST_FILENAME: ${{ matrix.test-case }}
115144

116145
- name: Logs
117146
if: always()

.github/workflows/unit-tests.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,8 @@ jobs:
3535

3636
- name: Set up Docker Buildx
3737
uses: docker/setup-buildx-action@v1
38-
39-
# build with docker so we can use layer caching
40-
- name: Cache Docker layers
41-
uses: actions/cache@v2
4238
with:
43-
path: /tmp/.buildx-cache-${{ env.docker-image }}
44-
key: ${{ runner.os }}-buildx-${{ env.docker-image }}-${{ github.workflow }}-${{ github.sha }}-${{ github.run_id }}
45-
restore-keys: |
46-
${{ runner.os }}-buildx-${{ env.docker-image }}-${{ github.workflow }}-${{ github.sha }}
47-
${{ runner.os }}-buildx-${{ env.docker-image }}-${{ github.workflow }}
48-
${{ runner.os }}-buildx-${{ env.docker-image }}
39+
buildkitd-flags: --debug
4940

5041
- name: Build
5142
id: docker_build
@@ -58,8 +49,8 @@ jobs:
5849
${{ env.DD_DOCKER_REPO }}/defectdojo-${{ env.docker-image }}:latest
5950
file: Dockerfile.${{ env.docker-image }}
6051

61-
cache-from: type=local,src=/tmp/.buildx-cache-${{ env.docker-image }}
62-
cache-to: type=local,dest=/tmp/.buildx-cache-${{ env.docker-image }}
52+
cache-from: type=gha
53+
cache-to: type=gha,mode=max
6354

6455
# run tests with docker-compose
6556
- name: Set unit-test mode

Dockerfile.django

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ RUN \
4747
uuid-runtime \
4848
# only required for the dbshell (used by the initializer job)
4949
postgresql-client \
50-
curl \
5150
&& \
5251
apt-get clean && \
5352
rm -rf /var/lib/apt/lists && \
@@ -77,9 +76,6 @@ COPY dojo/ ./dojo/
7776
# Add extra fixtures to docker image which are loaded by the initializer
7877
COPY docker/extra_fixtures/* /app/dojo/fixtures/
7978

80-
# Fallback for safety parser, if installation does't allow internet connectivity
81-
RUN curl -sS -o dojo/tools/safety/insecure_full.json https://raw.githubusercontent.com/pyupio/safety-db/master/data/insecure_full.json
82-
8379
COPY tests/ ./tests/
8480
RUN \
8581
# Remove placeholder copied from docker/certs

Dockerfile.integration-tests

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ RUN \
3030

3131
RUN pip install --no-cache-dir selenium requests chromedriver-autoinstaller
3232

33+
# Installing Chromedriver
34+
WORKDIR /opt/chrome-driver
35+
RUN \
36+
python -c "import chromedriver_autoinstaller; chromedriver_autoinstaller.install(cwd=True)" && \
37+
chmod -R 0755 .
38+
WORKDIR /app
39+
3340
COPY docker/wait-for-it.sh \
3441
docker/entrypoint-integration-tests.sh \
3542
/
@@ -38,11 +45,6 @@ COPY tests/ ./tests/
3845

3946
RUN chmod -R 0777 /app
4047

41-
# These 2 lines are needed for the chromium driver
42-
RUN chmod -R ugo+w /usr/local/lib/python3.8/site-packages
43-
RUN mkdir /.local
44-
RUN chmod -R ugo+w /.local
45-
4648
USER 1001
4749
ENV \
4850
DD_ADMIN_USER=admin \

0 commit comments

Comments
 (0)