diff --git a/.github/workflows/pubtests.yml b/.github/workflows/pubtests.yml index f747de43..a86621ee 100644 --- a/.github/workflows/pubtests.yml +++ b/.github/workflows/pubtests.yml @@ -3,7 +3,7 @@ name: Publish Test Results on: workflow_run: - workflows: ["Run regression tests"] + workflows: ["Call reusable regression workflow"] types: - completed permissions: {} diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index d4540954..44aeda7d 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -1,5 +1,5 @@ --- -name: 'Run regression tests' +name: 'Call reusable regression workflow' on: push: @@ -8,45 +8,11 @@ on: - cron: '0 22 * * 3' jobs: - regression: - name: regression - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 5 - submodules: recursive - - name: Install dependencies - run: sudo apt-get update && sudo apt-get -qq -y install gcc g++ cmake libboost-all-dev libcurl4-openssl-dev libgetdns-dev libhiredis-dev libmaxminddb-dev libluajit-5.1-dev libprotobuf-dev libreadline-dev libssl-dev libsodium-dev libsystemd-dev libyaml-cpp-dev libjsoncpp-dev uuid-dev libz-dev libtool pkg-config protobuf-compiler pandoc wget autoconf automake - - name: Download prometheus-cpp - run: git clone https://github.com/jupp0r/prometheus-cpp.git && cd prometheus-cpp && git checkout tags/v1.0.1 -b v1.0.1 && echo 'include(CPack)' >> CMakeLists.txt - - name: Build and Install prometheus-cpp - run: cd prometheus-cpp && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=off -DENABLE_PULL=off -DENABLE_PUSH=off -DENABLE_COMPRESSION=off -DENABLE_TESTING=off -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_POSITION_INDEPENDENT_CODE=ON && make && sudo make install - - name: Download Drogon - run: git clone https://github.com/drogonframework/drogon.git && cd drogon && git checkout tags/v1.9.1 -b v1.9.1 - - name: Build and Install Drogon - run: cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_ORM=OFF -DCMAKE_BUILD_TYPE=Release && make && sudo make install - - run: sudo sysctl -w vm.max_map_count=262144 - - run: autoreconf -i - - run: ./configure --enable-trackalert - - run: cd docker && make regression - env: - MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }} - - run: make dist - - run: make distcheck - - name: Upload Test Results - if: always() - uses: actions/upload-artifact@v3 - with: - name: Test Results - path: | - docker/tmp/*.xml - event_file: - name: "Event File" - runs-on: ubuntu-latest - steps: - - name: Upload - uses: actions/upload-artifact@v3 - with: - name: Event File - path: ${{ github.event_path }} + regression_clang: + uses: ./.github/workflows/regression_reusable.yml + with: + compiler: clang + regression_gcc: + uses: ./.github/workflows/regression_reusable.yml + with: + compiler: gcc \ No newline at end of file diff --git a/.github/workflows/regression_reusable.yml b/.github/workflows/regression_reusable.yml new file mode 100644 index 00000000..b192344f --- /dev/null +++ b/.github/workflows/regression_reusable.yml @@ -0,0 +1,52 @@ +--- +name: 'Run regression tests' + +on: + workflow_call: + inputs: + compiler: + description: 'Compiler to use' + type: string + required: true + +jobs: + run-regression: + name: regression-${{ inputs.compiler }} + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 5 + submodules: recursive + - name: Install dependencies + run: sudo apt-get update && sudo apt-get -qq -y install gcc g++ cmake libboost-all-dev libcurl4-openssl-dev libgetdns-dev libhiredis-dev libmaxminddb-dev libluajit-5.1-dev libprotobuf-dev libreadline-dev libssl-dev libsodium-dev libsystemd-dev libyaml-cpp-dev libjsoncpp-dev uuid-dev libz-dev libtool pkg-config protobuf-compiler pandoc wget autoconf automake + - name: Download prometheus-cpp + run: git clone https://github.com/jupp0r/prometheus-cpp.git && cd prometheus-cpp && git checkout tags/v1.0.1 -b v1.0.1 && echo 'include(CPack)' >> CMakeLists.txt + - name: Build and Install prometheus-cpp + run: cd prometheus-cpp && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=off -DENABLE_PULL=off -DENABLE_PUSH=off -DENABLE_COMPRESSION=off -DENABLE_TESTING=off -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_POSITION_INDEPENDENT_CODE=ON && make && sudo make install + - name: Download Drogon + run: git clone https://github.com/drogonframework/drogon.git && cd drogon && git checkout tags/v1.9.1 -b v1.9.1 + - name: Build and Install Drogon + run: cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_ORM=OFF -DCMAKE_BUILD_TYPE=Release && make && sudo make install + - run: sudo sysctl -w vm.max_map_count=262144 + - run: autoreconf -i + - run: ./configure --enable-trackalert + - run: cd docker && make regression-${{ inputs.compiler }} + - run: make dist + - run: make distcheck + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: | + docker/tmp/*.xml + event_file: + name: "Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: Event File + path: ${{ github.event_path }} diff --git a/common/webhook.cc b/common/webhook.cc index cd27dcb6..11ea96be 100644 --- a/common/webhook.cc +++ b/common/webhook.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include "webhook.hh" #include "dolog.hh" #include "hmac.hh" diff --git a/common/webhook.hh b/common/webhook.hh index c1e0b6b5..e5f0d7a5 100644 --- a/common/webhook.hh +++ b/common/webhook.hh @@ -23,8 +23,8 @@ #pragma once #include #include +#include #include "json11.hpp" -#include "ext/ctpl.h" #include "dolog.hh" #include "minicurl.hh" #include "prometheus.hh" diff --git a/common/wforce-webserver.hh b/common/wforce-webserver.hh index 3cacdbbc..7b0a62eb 100644 --- a/common/wforce-webserver.hh +++ b/common/wforce-webserver.hh @@ -34,7 +34,6 @@ #include "iputils.hh" #include "sstuff.hh" #include "sholder.hh" -#include "ext/ctpl.h" #include "drogon/drogon.h" #include "prometheus.hh" #include "perf-stats.hh" diff --git a/docker/regression/Dockerfile b/docker/regression/Dockerfile index 21d60559..7d41229b 100644 --- a/docker/regression/Dockerfile +++ b/docker/regression/Dockerfile @@ -41,17 +41,6 @@ RUN apt-get update && \ clang \ cmake -# Disable Ipv6 for redis -ARG MAXMIND_LICENSE_KEY -RUN wget -O GeoLite2-City.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${MAXMIND_LICENSE_KEY}&suffix=tar.gz" || true -RUN wget -O GeoLite2-Country.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${MAXMIND_LICENSE_KEY}&suffix=tar.gz" || true -RUN wget -O GeoLite2-ASN.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=${MAXMIND_LICENSE_KEY}&suffix=tar.gz" || true -RUN gunzip GeoLite2-*.mmdb.tar.gz || true -RUN tar xvf GeoLite2-City.mmdb.tar || true -RUN tar xvf GeoLite2-Country.mmdb.tar || true -RUN tar xvf GeoLite2-ASN.mmdb.tar || true -RUN mv GeoLite2*/GeoLite2-*.mmdb /usr/share/GeoIP || true - RUN pip3 install bottle virtualenv WORKDIR /wforce/ diff --git a/ext/ext/threadname.cc b/ext/ext/threadname.cc index 59490448..7822bcb1 100644 --- a/ext/ext/threadname.cc +++ b/ext/ext/threadname.cc @@ -1,10 +1,11 @@ /* - * This file is part of PowerDNS or dnsdist. + * This file is part of PowerDNS or weakforced. * Copyright -- PowerDNS.COM B.V. and its contributors * * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * In addition, for the avoidance of any doubt, permission is granted to * link this program with OpenSSL and to (re)distribute the binaries diff --git a/ext/ext/threadname.hh b/ext/ext/threadname.hh index 685116cf..3d6fd6c3 100644 --- a/ext/ext/threadname.hh +++ b/ext/ext/threadname.hh @@ -1,10 +1,11 @@ /* - * This file is part of PowerDNS or dnsdist. + * This file is part of PowerDNS or weakforced. * Copyright -- PowerDNS.COM B.V. and its contributors * * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * In addition, for the avoidance of any doubt, permission is granted to * link this program with OpenSSL and to (re)distribute the binaries diff --git a/regression-tests/RegressionGeoIP.mmdb b/regression-tests/RegressionGeoIP.mmdb new file mode 100644 index 00000000..616aba73 Binary files /dev/null and b/regression-tests/RegressionGeoIP.mmdb differ diff --git a/regression-tests/wforce-tw.conf b/regression-tests/wforce-tw.conf index 45be1670..e223d12f 100644 --- a/regression-tests/wforce-tw.conf +++ b/regression-tests/wforce-tw.conf @@ -226,8 +226,8 @@ end setCustomGetEndpoint("testCustomGet", testCustomGetFunc) -newGeoIP2DB("City", "/usr/share/GeoIP/GeoLite2-City.mmdb") -newGeoIP2DB("Country", "/usr/share/GeoIP/GeoLite2-Country.mmdb") +newGeoIP2DB("City", "RegressionGeoIP.mmdb") +newGeoIP2DB("Country", "RegressionGeoIP.mmdb") function geoip2(args) local ip_address