From patchwork Wed Dec 8 17:02:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1565367 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=g/qkkI4E; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J8Nlg3Rt9z9tk5 for ; Thu, 9 Dec 2021 04:03:11 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4J8Nlg2JyZz3bY9 for ; Thu, 9 Dec 2021 04:03:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=g/qkkI4E; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::431; helo=mail-pf1-x431.google.com; envelope-from=vicamo@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=g/qkkI4E; dkim-atps=neutral Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4J8NlL2yfHz3bhl for ; Thu, 9 Dec 2021 04:02:54 +1100 (AEDT) Received: by mail-pf1-x431.google.com with SMTP id r130so3013746pfc.1 for ; Wed, 08 Dec 2021 09:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=OmOqV1lErG9IFOXGgfnJwEAvIUpDKOwYQ5gBLXkDTmI=; b=g/qkkI4EVY2OJHuyBkbldOpPnLhcEThecbvArZUU28pAtdZ4ezkHWCRl3ul/tgG5DP TK4zjBrwV12QE/8KKsNtunqhjEzlCkMZIkfTgKKA0I+ecn8N9hncKpmJCyr48eGVffO1 moPwPvtQhPCUnGsvObmU0jcgxpV1cUIhJxZqNNtghwvG85tKAn8gaoKfLDKoocDC7TYA u1gf+ECch6PRwoseCvnyJ7TXGB+h7sOPAL4b0vymEn0/vULOmpI8O30DseajlxOC/A29 2acnNgC3kai4uONwL3jF5kNrFqdmT6gNcKcQj49h1hswyK4NlVGtDVnO/4yoh2aY+C+Q TYVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OmOqV1lErG9IFOXGgfnJwEAvIUpDKOwYQ5gBLXkDTmI=; b=uMe1GRxBgmqKR+gnuvMYIphsx/MBv1vaknsRsDpidScHc8KX9qNdOm6ZxcwBdpXo6L Gn+nntPt0v2IrqVQflSYJH/7Km5EbKXwbh8M6sw4pPEx3TSoYTDSXyxj6zNAgLvyOmen yB7x2mv9ZzOQJNzkE1HSu8hLKWhcH3yPP2YnAdJ+ju2IvREPPIoTOIXGls5i/QYdQzuO FnQ9im5MLZDk2p1ePxQVwu/it559fjAqrh2kmJZz43gz5lENg5TFKDSp9bfIqLbFb7v0 +aK9mQXQ93v+7f3aXysMPJdxGQFC3svqRAIFmxuWYhMONwFPJH5PTn47TcJJnqhbQJnn VmTw== X-Gm-Message-State: AOAM530romEVLH0Pa0u9/cCu2DT5ev0VtYrw78fjXCrq7eziTuGKlM6o JoFWgCH1x5nHf2InpTyeEU3dbWnZ0PQ= X-Google-Smtp-Source: ABdhPJxa2xHMvckMxeQQjQEG64gv/mvP008mMomglDS7nYF/QyCXuPvaGj3yqyfTDIIzJzJdkXRa9A== X-Received: by 2002:a63:a0b:: with SMTP id 11mr31069255pgk.282.1638982967544; Wed, 08 Dec 2021 09:02:47 -0800 (PST) Received: from localhost (218-173-141-247.dynamic-ip.hinet.net. [218.173.141.247]) by smtp.gmail.com with ESMTPSA id y31sm4735821pfa.92.2021.12.08.09.02.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 09:02:47 -0800 (PST) From: You-Sheng Yang To: patchwork@lists.ozlabs.org Subject: [PATCH v3 3/6] ci: test supported docker container operations Date: Thu, 9 Dec 2021 01:02:35 +0800 Message-Id: <20211208170238.142017-4-vicamo@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211208170238.142017-1-vicamo@gmail.com> References: <20211208170238.142017-1-vicamo@gmail.com> MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Signed-off-by: You-Sheng Yang --- .github/workflows/ci.yaml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d37cdbf..6e9033d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -116,6 +116,8 @@ jobs: strategy: matrix: db: [postgres, mysql] + env: + COMPOSE_FILE: ${{ matrix.db == 'mysql' && 'docker-compose.yml' || 'docker-compose-pg.yml' }} steps: - name: Checkout source code uses: actions/checkout@v2 @@ -125,11 +127,30 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.9 - - name: Bring up docker-compose service - env: - COMPOSE_FILE: ${{ matrix.db == 'mysql' && 'docker-compose.yml' || 'docker-compose-pg.yml' }} + - name: Build docker-compose service run: | docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) + - name: Test createsuperuser/changepassword + run: | + docker-compose run -T --rm web \ + python manage.py createsuperuser \ + --username patchwork --no-input --email test@example.com + { echo patchwork; echo patchwork; } | \ + docker-compose run -T --rm web \ + python manage.py changepassword patchwork + - name: Test dbbackup/dbrestore + run: | + docker-compose run -T --rm web python manage.py dbbackup + echo y | docker-compose run -T --rm web python manage.py dbrestore + - name: Modify database user permissions (mysql) + if: ${{ matrix.db == 'mysql' }} + run: | + docker-compose exec -T -- db \ + sh -c "exec mysql -uroot -p\"\${MYSQL_ROOT_PASSWORD}\" -e \"GRANT ALL ON \\\`test\\_\${MYSQL_DATABASE}%\\\`.* to '\${MYSQL_USER}'@'%'; FLUSH PRIVILEGES;\"" + - name: Run unittest + run: docker-compose run -T --rm web tox + - name: Test normal startup + run: | docker-compose up --detach for count in $(seq 50); do \ @@ -140,12 +161,6 @@ jobs: done echo - docker-compose exec -T web \ - python manage.py createsuperuser \ - --username patchwork --no-input --email test@example.com - { echo patchwork; echo patchwork; } | \ - docker-compose exec -T web \ - python manage.py changepassword patchwork docker-compose ps - name: Test client access (git-pw) run: |